<%
'连接数据库
'执行sql 改你要的sql
set rs=server.CreateObject("adodb.recordset")%>
rs.open "select * from news order by id desc ",conn,1,3
下面的代码就复制用可以了
'分页
i=50
rs.pagesize=i
pu=request("pu")
if pu="" then pu=1
if cint(pu)<="0" then pu=1
if cint(pu)>rs.pagecount then pu=rs.pagecount
if not rs.eof then rs.absolutepage=cint(pu)
'显示记录
if not rs.eof then
do while not rs.eof and i=>1
response.write rs("字段")'显示字段
'就这里改你要的,其它复制用就可以
rs.movenext
i=i-1
loop
end if
%>
当前第 <%=pu%> 页;分
<%=rs.pagecount%> 页;
共 <%=rs.recordcount%> 条记录;
每页<%=i%>条记录
<a href="?pu=1">首 页</a>
<a href="?pu=<%=cint(PU)-1%>">上一页</a>
<a href="?pu=<%=cint(PU)+1%>">下一页</a>
<a href="?pu=<%=rs.pagecount%>">末 页</a>
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。