Sub show()
logusername = replace(trim(request.Querystring("logusername")),"'","")
if logusername <> "" then
sql="select * from JB_log where username='"+ logusername +"' order by logid desc"
logpage = "&logusername="& logusername
logtext = "当前显示"& logusername &"的操作日志 | 显示全部"
else
sql="select * from JB_log order by logid desc"
End if
set rs = server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
%>
<% if pagecount < 1 then pagecount = 1 response.Write "页次:"& PAGECOUNT &"/" & page &"页 每页"& rs.pageSize &" 记录"&rs.recordCount&" " %> | 分页: <% beginpage = 1 endpage = CInt(pagecount) page = CInt(page) if pagecount >= 9 then if page >= 5 then beginpage = page - 4 if page <= (pagecount - 4) then endpage = page + 4 else endpage = pagecount beginpage = pagecount - 4 end if else beginpage = 1 endpage = 9 end if end if if beginpage>1 then response.write " 9" for j = beginpage to endpage if j = page then response.write" [" & j & "] " else response.write" [" & j & "] " end if next if endpage < pagecount then response.write " :" %> |
如果你用dreamweaver的话有一个更简单的办法,你先产生一个记录集然后
菜单,插入——〉应用程序对象——〉记录集分页——〉记录集导航条
只要按照提示就非常简单的就可以实现啦!
使用ASP.NET中的分页控件就可以。
刷分