eateobject("adodb.recordset")
conn = "DBQ=" + server.mappath("zheng.mdb") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
sql="select * from user"
mrs.open sql,conn,1,1
If mRs.bof and mRs.eof then
Response.Write"<span>没有任何记录</span>"
Response.End
Else
mRs.PageSize =6''每页记录条数
iCount=mRs.RecordCount ''记录总数
iPageSize=mRs.PageSize
maxpage=mRs.PageCount
page=request("page")
If Not IsNumeric(page) or page="" then
page=1
Else
page=cint(page)
End If
If page<1 then
page=1
ElseIf page>maxpage then
page=maxpage
End If
mRs.AbsolutePage=Page
If page=maxpage then
x=iCount-(maxpage-1)*iPageSize
Else
x=iPageSize
End If
End If
for i=1 to mRs.pagesize
%>
<tr>
<td width="64%" bgcolor="#FFFFFF" class="STYLE1"><%=mrs("name")%></td>
<td width="36%" bgcolor="#FFFFFF" class="STYLE1"><%=mrs("pass")%></td>
</tr><%
mRs.movenext
If mRs.eof then exit for
next
mRs.close
Set mRs=nothing
%>
<tr>
<td colspan="2" bgcolor="#CCCCCC">
<span class="STYLE1">
<%
call PageControl(iCount,maxpage,page)
Sub PageControl(iCount,pagecount,page)
''生成
链接 Dim query, a, x, temp
action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
query = Split(Request.ServerVariables("QUERY_STRING"), "&")
For Each x In query
a = Split(x, "=")
If StrComp(a(0), "page", vbTextCompare) <> 0 Then
temp = temp & a(0) & "=" & a(1) & "&"
End If
Next
Response.Write("<table border=''0'' cellpadding=''3'' style=''border-collapse: collapse'' width=''100%'' align=''center''>")
Response.Write("<form method=get onsubmit=""document.location = ''" & action & "?" & temp & "Page=''+ this.page.value;return false;""><tr>")
Response.Write("<td align=''center'' bgcolor=''#FFFFFF''>")
If page<=1 then
Response.Write ("首页 " )
Response.Write (" ")
Else
Response.Write("<a href=" & action & "?" & temp & "Page=1>首页</a> ")
Response.Write("<a href=" & action & "?" & temp & "Page=" & (Page-1) & "></a> ")
End If
If page>=pagecount then
Response.Write (" ")
Response.Write ("尾页 ")
Else
Response.Write("<a href=" & action & "?" & temp & "Page=" & (Page+1) & "></a> ")
Response.Write("<a href=" & action & "?" & temp & "Page=" & pagecount & ">尾页</a> ")
End If
Response.Write(" 页次:" & page & "/" & pageCount & " 页")
Response.Write(" 共有 " & iCount & " 条留言")
Response.Write(" 转到 " & "<input tyep=text name=page maxlength=5 value=" & page & " style=''font-size: 12px;border: 1px solid #CCCCCC;width:23px;''>" & " 页 <input type=submit style=""font-size: 9pt"" value=GO style=''font-siz