<%
curDir = Server.MapPath("***.mdb")
set newcon=server.createobject("adodb.connection")
newcon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curDir
set toprs=server.createobject("adodb.recordset")
toprs.open sql,newcon,3,3
if not toprs.eof then
toprs.pagesize=10 '设置分页数
pageno=request.querystring("pageno")
if pageno=empty then
pageno=1
end if
if cint(pageno)<=1 then
pageno=1
end if
if cint(pageno)>=toprs.pagecount then
pageno=toprs.pagecount
end if
toprs.absolutepage=cint(pageno)
zs=toprs.pagecount
xxhh=0
do while xxhh<10 and (not toprs.eof) '修改10来设置分页数
xxhh=xxhh+1
%>
//这里面写显示你数据库数据的代码
<%
toprs.MoveNext
Loop
end if
%>
<tr>
<td align=center bgcolor="#EFEFEF">
<%if pageno>1 then%>
<a href=<%="xntz.asp?pageno=1"%>>首页</a>
<a href=<%="xntz.asp?pageno="&pageno-1%>>上页</a>
<%End if
if CInt(pageno)<CInt(total) then
%>
<a href=<%="xntz.asp?pageno="&pageno+1%>>下页</a>
<a href=<%="xntz.asp?pageno="&zs%>>尾页</a>
<%End if%>
<%="当前页/总页数("&pageno&"/"&total&")"%>
</td>
</tr>
< % For I=1 To Rlt.Pagesize% >
< % If Rlt.Eof Then
Exit For
End If% >
< Li >< %=I% >. < %=Trim(Rlt("Product_Name"))< /Li >
< %Rlt.Movenext
Next% >
< %Rlt.Close% >