高分求 asp完整的,可用的分页代码
从数据库读出来记录,有N条, 每 10条 分一页
如果是函数更好,请标住要传的参数
试过后能用,立马给分!!
------解决方案-------------------- <%
sqlcmd= "select * from 表名 "
rs.open sqlcmd,conn,1,1
'打开数据集后写一下内容
pagesize=10
rscount=rs.recordcount
pagecount=rscount\pagesize
if pagecount <rscount/pagesize then pagecount=pagecount+1
page=clng(request( "page "))
rs.pagesize=pagesize
if page <1 then page=1
if page> rs.pagecount then page=rs.pagecount
if rscount> 0 then rs.absolutepage=page
%>
<% '下面的 就是分页了
PageList rscount,pagecount,pagesize,page
rs.close
%>
------解决方案--------------------http://www.yeat.org/blog/blogview.asp?logID=248
这个是叶子的分页~
下了用吧!记得给分哟!
------解决方案-------------------- <%
dim keyword
keyword=request( "key ")
dim page
page=request( "page ")
PageSize = 10
sql= "select * from table "
set rs=server.createobject( "adodb.recordset ")
rs.open sql,conn,1
rs.PageSize = PageSize
totalfilm=rs.recordcount
pgnum=rs.Pagecount
if page= " " or clng(page) <1 then page=1
if clng(page) > pgnum then page=pgnum
if pgnum> 0 then rs.AbsolutePage=page
%>
-------------读库
<tr> <form action= " ">
<td align=right>
[ <b> <%=rs.pagecount%> </b> / <%=page%> 页] [共 <%=totalfilm%> 个] <%if page=1 then%> [首 页] [上一页] <% else %> [ <a href= "?page=1&liaohao_s= <%=request( "liaohao_s ")%> &daihao_s= <%=request( "daihao_s ")%> &paixu= <%=request( "paixu ")%> "> 首 页 </a> ]
[ <a href= "?page= <%=page-1%> &liaohao_s= <%=request( "liaohao_s ")%> &daihao_s= <%=request( "daihao_s ")%> &paixu= <%=request( "paixu ")%> "> 上一页 </a> ] <%end if%> <%if rs.pagecount-page <1 then%> [下一页] [尾 页] <%else%> [ <a href= "?page= <%=page+1%> &liaohao_s= <%=request( "liaohao_s ")%> &daihao_s= <%=request( "daihao_s ")%> &paixu= <%=request( "paixu ")%> "> 下一页 </a> ] [ <a href= "?page= <%=rs.pagecount%> &liaohao_s= <%=request( "liaohao_s ")%> &daihao_s= <%=request( "daihao_s ")%> &paixu= <%=request( "paixu ")%> "> 尾 页 </a> ] <%end if%> <input type=hidden name= "paixu " value= " <%=request( "paixu ")%> "> <input type=hidden name= "liaohao_s " value= " <%=request( "liaohao_s ")%> "> <input type=hidden name= "daihao_s " value= " <%=request( "daihao_s ")%> "> <input type= 'text ' name= 'page ' size=2 maxlength=10 style= "font-size:9pt;color:#FFFFFF;background-color:#666666;border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000 " value= " <%=request( "page ")%> " align=center> <input style= "border:1 solid black;FONT-SIZE: 9pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; HEIGHT: 18px; LINE-HEIGHT: normal " type= 'submit ' value= ' Goto ' size=2> </td>
</form>