<%If Request.ServerVariables("CONTENT_LENGTH")=0 then
intCur=1
Else
intCur=CInt(Request.Form("CurPage"))
End If
Set oRs = Server.CreateObject("ADODB.Recordset")
Set oRs.ActiveConnection = oConn
oRs.Source = "select * from 表名"
oRs.CursorType = 3
oRs.LockType = 3 'adLockOptimistic
oRs.pagesize= 5'每页要显示的记录数
oRs.Open
num=oRs.pagecount
Select Case Request.Form("Page")
Case "首 页"
intCur=1
Case "上一页"
intCur=intCur-1
Case "下一页"
intCur=intCur+1
Case "尾 页"
intCur=CInt(Request.Form("LastPage"))
End Select
oRs.AbsolutePosition = CInt(intCur)
for i = 1 to rs.pagesize
if oRs.eof then exit for
' 显示记录
rs.movenext
next
oRs.Close
set oRs=nothing
oConn.Close
Set oConn=Nothing
<%
if not isnumeric(page) then page=1
rs.absolutepage = request("page")
rs.pagesize=3
for i = 1 to rs.pagesize
if rs.eof then exit for
' display the fields which you want to display
rs.movenext
next
%>