标题:请教:为何提示“索引越界”?
只看楼主
happyhu
Rank: 1
等 级:新手上路
帖 子:292
专家分:0
注 册:2005-7-12
 问题点数:0 回复次数:1 
请教:为何提示“索引越界”?

程序如下:
for i=1 to 28
set rs = server.CreateObject ("adodb.recordset")
sqlstr="select * from piaoy"
rs.Open sqlstr,conn,1,3
rs.addnew
rs("bh")=trim(request.form("包号")(i))
rs("tm")=trim(request.form("条码")(i))
rs("yph")=trim(request.form("样批号")(i))
rs("zmdj")=trim(request.form("籽棉等级")(i))
rs("mzh")=trim(request.form("毛重")(i))
rs("jzh")=trim(request.form("净重")(i))
rs("hchl")=trim(request.form("回潮率")(i))
rs("pzh")=trim(request.form("皮重")(i))
rs("jglx")=trim(request.form("加工类型")(i))
rs("chpmch")=trim(request.form("产品名称")(i))
rs("shchrq")=trim(request.form("产品名称")(i))
rs("jgnd")=trim(request.form("加工年度")(i))
rs("jyjgmch")=trim(request.form("检验机构名称")(i))
rs("pj")=trim(request.form("品级")(i))
rs("chdj")=trim(request.form("长度级")(i))
rs("mklzhj")=trim(request.form("马克隆值级")(i))
rs("mklzh")=trim(request.form("马克隆值")(i))
rs("hzl")=trim(request.form("含杂率")(i))
rs("ygzhl")=trim(request.form("轧工质量")(i))
rs("szdj")=trim(request.form("色泽等级")(i))
rs("chdzhqd")=trim(request.form("长度整齐度")(i))
rs("dxwzhsh")=trim(request.form("短纤维指数")(i))
rs("fshl")=trim(request.form("反射率")(i))
rs("hd")=trim(request.form("黄度")(i))
rs("dlshchl")=trim(request.form("断裂伸长率")(i))
rs("bqd")=trim(request.form("比强度")(i))
rs("chshdxsh")=trim(request.form("成熟度系数")(i))
rs("chd")=trim(request.form("产地")(i))
rs("bzh")=trim(request.form("备注")(i))
rs.Update
rs.Close
set rs=nothing

next
response.write "<font color=#000000>excel表中的 "& recCnt & " 组数据已成功写入数据库!<a href='xs.asp' target='_blank'>显示数据库</a></font>"

运行的时候出现错误:

请求对象 错误 'ASP 0105 : 80004005'

索引越界

但是我如果把出错的一行: rs("szdj")=trim(request.form("色泽等级")(i))
后面的: rs("szdj")=trim(request.form("色泽等级")(i))
rs("chdzhqd")=trim(request.form("长度整齐度")(i))
rs("dxwzhsh")=trim(request.form("短纤维指数")(i))
rs("fshl")=trim(request.form("反射率")(i))
rs("hd")=trim(request.form("黄度")(i))
rs("dlshchl")=trim(request.form("断裂伸长率")(i))
rs("bqd")=trim(request.form("比强度")(i))
rs("chshdxsh")=trim(request.form("成熟度系数")(i))
rs("chd")=trim(request.form("产地")(i))
rs("bzh")=trim(request.form("备注")(i))
这些去掉的话就能正常执行,不知道为什么?郁闷死了!难道还有插入字段数的限制不成??!!
请高手执教,谢谢!!!

搜索更多相关主题的帖子: 索引越界 提示 
2006-10-28 08:59
happyhu
Rank: 1
等 级:新手上路
帖 子:292
专家分:0
注 册:2005-7-12
得分:0 
不好意思,问题解决了,是我的一个字段写错了,谢谢大家!

2006-10-28 09:26



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-99253-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.176095 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved