asp如何让他分页显示?.每页显示10行

来源:百度知道 编辑:UC知道 时间:2024/05/27 08:29:25
<body><%
set conn=server.createobject("adodb.connection")

conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("net.mdb")
%>

<%
exec="select * from new order by id desc"

set rs=server.createobject("adodb.recordset")
rs.PageSize=3
rs.open exec,conn,1,1

%>

<table width="600" border="0" cellspacing="0" cellpadding="0">
<%do while not rs.eof%><tr>
</tr>
<table width="333"
border="0" align="center" cellpadding="0" cellspacing="0"
background="images/newsbj.jpg">
<tbody>
<tr>
<td width="13%" height="27"> </td>
<td width=&quo

直接改好就算了
下面给你贴段分页的代码你参考一下
这个是我刚写的一个系统的管理后台的分页显示管理
自己研究才有进步

说明 注意那个PAGE是分页的页码
conn.asp是一个数据库连接文件
<!--#include file="conn.asp"-->

<%
Page=Request.QueryString("Page")
if Int(Page)="" or int(page)<1 then
currentPage=1
else
currentPage=cint(Page)
end if
set rs=server.createobject("adodb.recordset")
sql="select * from tbl_article order by exacttime desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
rseof=1
else
rseof=2
MaxPerPage=23
PageUrl="admin_art_mnr.asp"
totalPut=rs.recordcount
if currentpage<1 then currentpage=1
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
end if