悟空传告诉我们的道理:帮手查查分页代码错在那里

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 07:11:35
<!--#include file = "conn.asp"-->
<%
sql="select id,showname,hits,size ,note from download"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
dim pagesize
dim pagecount
%><%
sql="select * from download"
set rs=server.createobject("adodb.recordset")
rs.pagesize=3
pagecount=rs.pagecount
page=int(request.querystring("page"))
if page<=0 then page=1
if request.querystring("page")=""then page=1
rs.absolutepage=page
%>
<table width="595" cellspacing="0" cellpadding="0">
<td>每页显示<b><%=rs.pagesize%></b>
条栏目共有<b><%=rs.recordcount%></b>页<%if pagecount=1and rs.pagecount<>pagecount and rs.pagecount<>0 then %>
<a href="?page=<%=cstr(pagecount+1)%>">下一页</a>
<%end if %>
<% if rs.pagecount>1 and rs.pagecount=pagecount then %>
<a href="?page=<%=cstr(pagecount-1)%>">上一页</a>
<% end if %>

</td></table>
对象关闭时,不允许操作。
/download/download.asp, 第 103 行
pagecount=rs.pagecount