请问下标越界是怎么回事啊!!!
不知道这段代码那里错了,老提示下标越界。我是想做一个分页显示数据表内容的程序,一页显示10条。请高手速达,在线等。。。。。先谢过了~下面贴出错误报告:
错误类型:
Microsoft VBScript 运行时错误 (0x800A0009)
下标越界
/address/index.asp, 第 58 行
<%
if not isempty(request.Form("page")) then
page=cint(request.Form("page"))
else
page=1
end if
set rs=server.CreateObject("adodb.recordset")
sql="select*from user"
rs.open sql,secondconn,1,1
if rs.eof and rs.bof then
response.Write"<p align='center'>对不起,没有找到相关信息!</p>"
else
const maxperpage=10
rs.pagesize=maxperpage
totalrecord=rs.recordcount
totalpage=rs.pagecount
if page>totalpage then
page=totalpage
rs.absolutepage=page
end if
i=0
dim truename(),nickname(),quanxian(),email(),userlogincount()
do while not rs.eof and (i<rs.pagesize)
i=i+1
redim preservetruename(i),nickname(i),quanxian(i),email(i),userlogincoount(i)
truename(i)=rs("truename") ‘这是第58行
nickname(i)=rs("nickname")
if rs("quanxian")="master" then
quanxian(i)="班级管理员"
elseif rs("quanxian")="member" then
quanxian(i)="班级成员"
else
quanxian(i)="未审核"
end if
email(i)=rs("email")
userlogincount(i)=rs("logincount")
%>
<tr>
<td align="center"><%=i%></td>
<td align="center"><%=truename(i)%></td>
<td align="center"><%=nickname(i)%></td>
<td align="center"><%=email(i)%></td>
<td align="center"><%=quanxian(i)%></td>
<td align="center"><%=userlogincount(i)%></td>
</tr>
<%rs.movenext
loop
end if
rs.close
set rs=nothing
%>