大雀软件园

首页 软件下载 安卓市场 苹果市场 电脑游戏 安卓游戏 文章资讯 驱动下载
技术开发 网页设计 图形图象 数据库 网络媒体 网络安全 站长CLUB 操作系统 媒体动画 安卓相关
当前位置: 首页 -> 技术开发 -> ASP专区 -> 1栏分页显示(附显示的形式前页,后页),此程序可直接套用

1栏分页显示(附显示的形式前页,后页),此程序可直接套用

时间: 2021-07-31 作者:daque

表露的情势idname 1juliet 2cristine 3boy 4girl>>首页 前页 后页 尾页 页数:1/44记载/页 总记载数:13条代码:<!--page.asp--><!--#include file="conn.asp"--><html><body bgcolor="#ffffff" text="#000000"><table width="60%" border="1" align="center"><%dim rsdim sqlmsg_per_page=4'设置每页表露记载条数set rs=server.createobject("adodb.recordset")sql = "select * from page order by id"'改成你本人的sql语句rs.cursorlocation=3'运用存户端游标,不妨使功效普及rs.pagesize=msg_per_page'设置分页记载集每页表露记载数rs.open sql,conn,0,1if err.number<>0 then'缺点处置response.write "数据库操纵波折:" & err.descriptionerr.clearelseif not (rs.eof and rs.bof) then'检验和测定记载集能否为空totalrec=rs.recordcount'totalrec:总记载条数if rs.recordcount mod msg_per_page=0 then'计划总页数,recordcount:数据的总记载数n=rs.recordcount\msg_per_page'n:总页数elsen=rs.recordcount\msg_per_page+1end ifcurrentpage=request("page")'currentpage:暂时页if currentpage <> "" thencurrentpage =cint(currentpage)if currentpage < 1 thencurrentpage = 1end ifif err.number <> 0 then err.clearcurrentpage=1end ifelsecurrentpage = 1end ifif currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec)then currentpage=1end ifrs.absolutepage=currentpage'absolutepage:树立南针指向某页发端rowcount=rs.pagesize'pagesize:树立每一页的数据记载数dim idim k%><tr align="center" valign="middle"> <td width="50%">id</td><td width="50%">name</td></tr><%do while not rs.eof and rowcount > 0%><tr align="center" valign="middle"><td width="25%"><%=rs("id")%></td><td width="25%"><%=rs("testname")%></td></tr><%rowcount=rowcount-1rs.movenextloopend ifend ifrs.closeset rs=nothing%><table border="0" align="center"><tr><td align="center" valign="middle"> <%call listpages()%></td></tr></body></html><%sub listpages()if n <= 1 then exit sub%><p><span class=smallfont>>> <%if currentpage=1 then%><font color=darkgray face="arial" >top previous</font><%else%><font color=black face="arial"><a href="<%=request.servervariables("script_name")%>?page=1">top</font></a> <a href="<%=request.servervariables("script_name")%>?page=<%=currentpage-1%>"><font color=black face="arial" >previous</a></font><%end if%><%if currentpage=n then%><font color=darkgray face="arial" >next bottom</font><%else%><font color=black face="arial" ><a href="<%=request.servervariables("script_name")%>?page=<%=currentpage+1%>">next</a> <a href="<%=request.servervariables("script_name")%>?page=<%=n%>">bottom</a></font><%end if%><font color=black face="arial" >  page:<%=currentpage%>/<%=n%>pages  <%=msg_per_page%>notes/page   total:<%=totalrec%>notes</font></span></p><%end sub%>

热门阅览

最新排行

Copyright © 2019-2021 大雀软件园(www.daque.cn) All Rights Reserved.