本人的分页代码如下:
<%dim connstr
connstr="provider=Microsoft.Jet.OLEDB.4.0;Data source=" & server.MapPath("example.mdb")
set cn=server.CreateObject("adodb.connection")
cn.open connstr%>
<%set rs=server.CreateObject("adodb.recordset")
rs.open "select * from example",cn,1,1%>
<%rs.pagesize=2
zongye=rs.pagecount
page=int(request("page"))
if page<=0 then page=1
if request("page")="" then page=1
rs.absolutepage=page
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html";charset="gb2312">
<title>ASP示例学习</title></head>
<body>
<%
if rs.eof and rs.bof then
response.write "暂时没有留言!"
else
for r=1 to rs.pagesize
response.write "主题:" & rs("zhuti") & "<br>"
response.write "姓名:" & rs("name") & "<br>"
response.write "单位:" & rs("danwei") & "<br>"
response.write "电话:" & rs("tel") & "<br>"
response.write "EMAIL:" & rs("email") & "<br>"
response.write "时间:" & rs("time") & "<br>"
response.write "内容:" & rs("content") & "<hr>"
rs.movenext
next
end if
%>
<%for i=1 to zongye%>
<a href="fenye.asp?page=<%=i%>"><%=i%></a>
<%next%>
</body>
</html>
调试时显示的第一页没有问题,可是运行第二页就会出现如下错误:
错误类型:
(0x80020009)
发生意外。
/example/fenye.asp, 第 34 行(注--第34行即为:response.write "主题:" & rs("zhuti") & "<br>" )
我实在搞不懂这行有啥错啊?