以下为公用代码,必须具备。
<%filepath=request.servervariables("path_info")%>
<%page=1 '设置变量初始值PAGE=1
page=request.querystring("page") 'page值为接受值
rs.PageSize = 20 '每页显示记录数
if Not IsEmpty(trim(Request("Page"))) then '如果PAGE已经初始化...
Page = CInt(Request("Page")) '接收PAGE并化为数字型赋给PAGE变量
if Page > rs.PageCount then '如果接收的页数大于总页数
rs.AbsolutePage = rs.PageCount '设置当前显示页等于最后页
elseif Page <= 0 then '如果page小于等于0
Page = 1 '设置PAGE等于第一页
else
rs.AbsolutePage = Page '如果大于零,显示当前页等于接收的页数
end if
End if
Page = rs.AbsolutePage%>
补充:
<%
dscao=0
DO WHILE NOT dscao = rs.PageCount %>
<% dscao=dscao+1
loop
%>
<%
dim n,k
if (totalPut mod MaxPerPage)=0 then 'n表示总页数
n= totalPut \ MaxPerPage
else
n= totalPut \ MaxPerPage + 1
end if
k=currentPage
if k<>1 then
response.write "["+"首页] "
response.write "["+"上一页] "
else
Response.Write "[首页] [上一页]"
end if
if k<>n then
response.write "["+"下一页] "
response.write "["+"尾页] "
else
Response.Write "[下一页] [尾页]"
end if
'------------------------------------------------------页面跳转
关于博主

内容正在载入中...搜索博客文章
#Saperate
博客文章: 有关数据库分页
最近发表
- 内容正在载入中...
热门文章
- 内容正在载入中...
随机文章
- 内容正在载入中...
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
