[PageTest.asp]
<%
strsql = "SELECT * from authors"
SET RS = Server.createObject ("AdoDb.Recordset")
RS.Open Strsql, CONN, 1, 1
Set PageBase
Page.pageSize = 7
IF not isnumeric (Request ("page") ")") = 1) Then page.currentpage = 10 else page.currentpage = Request ("Page") End iFend IF
Page.LinkURL = "PageTest.asp"
Page.show (RS)
Page.fenye (RS)%>
[Object.asp]
<%
'**********************************' * '* class' *' * paging class "** ***************************************
Class PageBasedim Pagesize 'Documentary DIM CURRENTPAGE' Each page DIM CURRENTPAGE 'Of course, DIM LINKURL' Dynamic URL
Sub show (ORS)
'Sub-programs displaying the page symbol ----------------------------------------------------------------------------------------------------------------- -------------------- i = 0 rs.move Pagesize * (CurrentPage-1) Do While Not Ors.eof and i
'Sub-programs displaying the page symbol ----------------------------------------------------------------------------------------------------------------- --------------------
Sub Fenye (ORS)
Totalput = ors.recordcount pageSum = Totalput / Pagesize IF (Pagesum = "0") THEN PAGESUM = 1
'If it is the first page response.write "" & currentpage & "page / total" & pagesum & "page"
maxpage = 0 minpage = 0 if then minpage = currentpage-5 if (currentpage 4)> pagesum then maxpage = pagesum else maxpage = currentpage 4 end if else minpage = 1 if pagesum ((currentpage-5)> 1)> 10 Then maxpage = 10 else maxpage = Pagesum End (CINT (CURRENTPAGE-1)> 0) THEN IF (CINT (CURRENTPAGE-1)> CINT (PAGRENTPAGE-1)> CINT (PAGESUM)) THEN RESE.WRITE " << Previous a> "else response.write" << Previous a> "end if End if for j = minpage to maxpage 1 IF (CINT (j) = cint (currentpage)) Then response.write "[" & j & "]" else response.write "[ = 0) Then response.write" <=">¤tpage 1&"> Next Page >> "end if Response.write"
"End Sub
END CLASS%>
[Conn.asp]