一个分页程序,为什么最后一页无法显示 大家来帮下忙 谢谢
<%dim data
data="BBS.mdb"
dim connstr
connstr="Provider=Microsoft.Jet.OLEDB.4.0; Data source=" & Server.mappath(data)
set conn=Server.createObject("ADODB.Connection")
conn.open connstr
%>
<%sql="select * from B_bbs"
set rs=Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,3
%>
<%rs.pagesize=10
total=rs.pagecount
page=int(request("page"))
if page<=0 then page=1
if request("page")="" then page=1
rs.Absolutepage=page
%>
<%if rs.eof and rs.bof then
response.write"暂时还没有记录"
else
for i= 1 to rs.pagesize
response.write("楼主:"&rs("username")&"<br>")
response.write("主题:"&rs("topic")&"<br>")
response.write("内容:"&rs("body")&"<br>")
response.write("提交时间:"&rs("dateandtime")&"<br>")
response.write("<hr>")
rs.movenext
next
end if
%>
<%
for i=1 to total
%>
<a href=fenye.asp?page=<%=i%>><%=i%></a>
<%next%>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
data="BBS.mdb"
dim connstr
connstr="Provider=Microsoft.Jet.OLEDB.4.0; Data source=" & Server.mappath(data)
set conn=Server.createObject("ADODB.Connection")
conn.open connstr
%>
<%sql="select * from B_bbs"
set rs=Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,3
%>
<%rs.pagesize=10
total=rs.pagecount
page=int(request("page"))
if page<=0 then page=1
if request("page")="" then page=1
rs.Absolutepage=page
%>
<%if rs.eof and rs.bof then
response.write"暂时还没有记录"
else
for i= 1 to rs.pagesize
response.write("楼主:"&rs("username")&"<br>")
response.write("主题:"&rs("topic")&"<br>")
response.write("内容:"&rs("body")&"<br>")
response.write("提交时间:"&rs("dateandtime")&"<br>")
response.write("<hr>")
rs.movenext
next
end if
%>
<%
for i=1 to total
%>
<a href=fenye.asp?page=<%=i%>><%=i%></a>
<%next%>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
这段代码 看起来没什么错误啊 ,除开最后一页,每一页都能正常显示,但是为什么最后一页却报错 说
Script error detected at line 27
Source line: response.write("楼主:"&rs("username")&"
")
真是奇怪啊 ,谁能告诉我原因啊?