好东西,翻页程序,大家可以参考
类别: ASP教程
<%language="vbscript"
set conn=server.createobject("adodb.connection")
conn.open "driver={sql server};server=luo;uid=sa;pwd=;database=zszl"
set rs=server.createobject("adodb.recordset")%>
<%pgsize=5
page=request.querystring("page")
sql="select * from test where id1=1"
rs.open sql,conn,1
rs.pagesize=pgsize
pgnm=rs.pagecount
if page=""or clng(page)<1 then page=1
if clng(page)>pgnm then page=pgnm
if pgnm>0 then rs.absolutepage=page
count=0
do while not rs.eof and count<rs.pagesize
%><%=rs("id1")%><br>
<%=d%><br>
<%count=count+1
rs.movenext
loop
rs.close
set rs=nothing
%>
<a href=dis.asp?page=1>第一页</a>
<a href=dis.asp?page=<%=pgnm%>>最后一页</a>
<a href=dis.asp?page=<%=page+1%>>下一页</a>
<a href=dis.asp?page=<%=page-1%>>上一页</a>
set conn=server.createobject("adodb.connection")
conn.open "driver={sql server};server=luo;uid=sa;pwd=;database=zszl"
set rs=server.createobject("adodb.recordset")%>
<%pgsize=5
page=request.querystring("page")
sql="select * from test where id1=1"
rs.open sql,conn,1
rs.pagesize=pgsize
pgnm=rs.pagecount
if page=""or clng(page)<1 then page=1
if clng(page)>pgnm then page=pgnm
if pgnm>0 then rs.absolutepage=page
count=0
do while not rs.eof and count<rs.pagesize
%><%=rs("id1")%><br>
<%=d%><br>
<%count=count+1
rs.movenext
loop
rs.close
set rs=nothing
%>
<a href=dis.asp?page=1>第一页</a>
<a href=dis.asp?page=<%=pgnm%>>最后一页</a>
<a href=dis.asp?page=<%=page+1%>>下一页</a>
<a href=dis.asp?page=<%=page-1%>>上一页</a>
- 上一篇: 大部分的ADO的错误码对应的含义
- 下一篇: 如何使用ASP产生象安装向导的主页
-= 资 源 教 程 =-
文 章 搜 索