<% @ Lingots = "vbscript" codepage = "936"%>
<! Doctypehtmlpublic "- // w3c // dtdxhtml1.0transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<htmlxmlns = "http://www.w3.org/1999/xhtml">
<adal>
<Metahttp-Equiv = "Content-Type" Content = "Text / Html; charSet = GB2312" />
<Title> ASP 分页程序 </TITME>
<Styletype = "Text / CSS">
<! -
.Style1 {Font-Size: 12px}
->
</ style> </-head>
<body>
<p>
<TableWidth = "186" height = "39" border = "1" CellPadding = "0" CellSpacing = "0">
<tr>
<td> 姓名 </td>
<td> 密码 </td>
</tr>
<%
setrs = server.createObject ("adodb.recordSet")
Conn = "dbq =" + server.mappath ("zheng.mdb") + "; defaultdir =; driver = {MicrosoftAccessDriver (*. MDB)};"
SQL = "SELECT * FROMUSER"
Rs.OpenSQL, Conn, 1,2
Rs.PageSize = 6 '设置页面显示得页数
ifRequest ("page") <> "" puis
epage = cint (demande ("page"))
IFEPAGE <1Thenepage = 1
IFEPAGE> Rs.PageCountThenePage = Rs.PageCount
autre
Epage = 1
endire
Rs.Absolutepage = Epage
fori = 0tors.pagesize-1
ifrs.boforr.eofthenexitfor
%> <tr>
<td> <% = rs ("name")%> </td>
<td> <% = rs ("pass")%> </td>
</tr>
<%
Rs.MovEnext
suivant
%>
</ table>
<divalign = "Left"> <spanclass = "style1">
<formMethod = "get" onsubmit = "" document.location = "c.asp? page = '+ this.page.value; returnfalse;'">
<% ifepage = 1ThenResponse.Write ("首页") ElSeResponse.Write ("<Ahref = 'C.asp? Page = 1'>" & "首页" & "</a>")%>
<% ifepage = 1ThenResponse.Write ("上一页") ElSeResponse.Write "<Ahref = C.asp? Page =" & Epage-1 & "> 上一页 </a>"%>
<% ifEPAGE = Rs.PageCounttHenResponse.write ("下一页") ElSeResponse.Write "<Ahref = C.asp? Page =" & Epage + 1 & "> 下一页 </a>"%>
<% ifEPAGE = Rs.PageCounttHenResponse.write ("末页") ElSeResponse.Write "<Ahref = C.asp? Page =" & Rs.PageCount & "> 末页 </a>"%>
现在是第 <fontcolor = "red"> <% = epage%> </font> 页一页一 有 <fontcolor = "red"> <% = Rs.PageCount%> </font> 页