总算找到哪个错误了,刚才急死了,给分了:
dim db,rs,theSql,theCount,i
i=0
call OpenDBRS(db,rs)
theSql="Select * from assort"
rs.open theSql,db,1,2
theCount=rs.recordcount
dim IDEF()
dim LName()
redim IDEF(theCount)
redim LName(theCount)
'IDEF(1)="1"
'IDEF(2)="2"
'response.write IDEF(1)&IDEF(2)
do while not rs.eof
IDEF(i)=rs("LIDEF")
LName(i)=rs("LName")
rs.movenext
i=i+1
loop
response.write theCount
for i=0 to theCount
response.write IDEF(i)&LName(i)&"<br>"
next
得到了想要的数据。
原来的代码如下:上面是我测试之用的:我不知道数组哪里写错了,如得到解答,马上给分:
dim db,rs,rs2,theSql,i
call OpenDBRS(db,rs) '这是调用Connection和Recordset的函数,这是正确的
theSql="Select * from assort"
rs.open theSql,db,1,1
thecount=rs.recordcount '一直到此都正确
dim IDEF(thecount)
dim LName(thecount) '到这里,就报错,说:您要访问的网页有问题,无法显示
for i=0 to thecount
IDEF(i)=rs("LIDEF")
LName(i)=rs("LName")
next
response.write thecount"<br>"
for i=1 to thecount '测试之用,根本就看不到
response.write IDEF(i)&" "&LName(i)&"<br>"
next