求救~~~~~~分页代码!!!
不知道那里错了,请大侠给指点一下,老提示71行下标越界!!!<%
if not isempty(request("page")) then
page=cint(request("page"))
else
page=1
end if
set rs1=server.createobject("adodb.recordset")
sql1="select*from guestbook"
rs1.open sql1,secondconn,1,1
if rs1.eof and rs1.bof then
response.write"<p align='center'>关闭窗口!"
else
const maxperpage=10
rs1.pagesize=maxperpage
totalrecord=rs1.recordcount
totalpage=rs1.pagecount
if page>totalpage then page=totalpage
rs1.absolutepage=page
i=0
dim id(),author(),content(),leavetime(),replycontent(),replytime(),replyauthor()
do while not rs1.eof and i<rs1.pagesize
i=i+1
redim preserve id(i),author(i),content(i),leavetime(i),replycontent(i),replytime(i),replyauthor(i)
id(i)=rs1("id")
author(i)=rs1("author")
content(i)=rs1("content")
leavetime(i)=rs1("leavetime")
replycontent(i)=rs1("replycontent")
replytime(i)=rs1("replytime")
replyauthor(i)=rs1("replyauthor")
rs1.movenext
loop
end if
rs1.close
set rs1=nothing
%>
<%for i=totalrecord to 1 step -1%>
<table width="70%" border="0" cellpadding="5" cellspacing="1" bgcolor="#000000">
<tr>
<td width="81%" align="left" bgcolor="#FFFFFF" class="font14">第<%=i%>条 <%=author(i)%> 于<%=leavetime(i)%>留言</td> ‘71行
<%if session("quanxian")="master" then%>
<td width="19%" align="center" bgcolor="#FFFFFF" class="font14"><a href="reply.asp?id=<%=id(i)%>">回复</a> <a href="del.asp?id=<%=id(i)%>">删除</a></td>
<%end if%>
</tr>
<tr>
<td colspan="2" align="left" bgcolor="#FFFFFF" class="font14t"><%=content(i)%></td>
</tr>
<%if not replycontent(i)="无" then%>
<tr>
<td colspan="2" align="left" bgcolor="#FFFFFF" class="font14">管理员 <%=replyauthor(i)%> 于<%=replytime(i)%>回复</td>
</tr>
<tr>
<td colspan="2" align="left" bgcolor="#FFFFFF" class="font14t"><%=replycontent(i)%></td>
</tr>
<%end if%>
</table>
<%next%><br><br>
<table width="70%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle">
<div align="center" class="font14">
共有<%=totalrecord%>条记录,
每页<%=maxperpage%>条,共<font color=red><%=totalpage%></font>页 第<%=page%>页
<%if page-1>0 then%>
<a href="index.asp?page=<%=page-1%>">上一页</a>
<%else%>上一页<%end if%>
<%if page+1<=totalpage then%>
<a href="index.asp?page=<%=page+1%>">下一页</a>
<%else%>
下一页
<%end if%>
</div>