dim page
page=request("page")
PageSize = 5
读取数据库
rs.open sql,conn,1,1
rs.PageSize = PageSize '分页处理
totalfilm=rs.recordcount
pgnum=rs.Pagecount
if page="" then page=1
if clng(page)<1 then page=1
if clng(page) > pgnum then page=pgnum
if pgnum>0 then rs.AbsolutePage=page
count1=0
t=3
do while not rs.eof and count1<rs.PageSize
‘循环
rs.movenext
count1=count1+1
t=t+1
loop
翻页程序
[共<b><%=rs.pagecount%></b>页] [第<%=page%>页] [<%=pagesize%>条/页] [共<%=totalfilm%>条]
<%if page=1 then%>
[首 页] [上一页]
<% else %>
[<a href="?page=1&smsort=<%=request("smsort")%>&bigsort=<%=request("bigsort")%>&title=<%= request("title") %>">首
页</a>] [<a href="?page=<%=page-1%>&smsort=<%=request("smsort")%>&bigclass=<%=request("bigsort")%>&title=<%= request("title") %>">上一页</a>]
<%end if%>
<%if rs.pagecount-page<1 then%>
[下一页] [尾 页]
<%else%>
[<a href="?page=<%=page+1%>&smsort=<%=request("smsort")%>&bigsort=<%=request("bigsort")%>&title=<%= request("title") %>">下一页</a>]
[<a href="?page=<%=rs.pagecount%>&smsort=<%=request("smsort")%>&bigsort=<%=request("bigsort")%>&title=<%= request("title") %>">尾
页</a>]