Page Pagination | functions
Const MAXPERPAGE=18
Dim page
If not request ("page") = "" Then
Page=cint (Request ("page")
Else
Page=1
End If
Dim i
I=0
Rs.move (Page-1) *maxperpage
Paging
Do While
' The middle is a circular segment.
I=i+1
If I>=maxperpage then Exit Do
Rs.movenext
Loop
===========================
Totalnumber = total number of records
Maxperpage = number of records per page
filename = Paging file name
<%
function ShowPage (totalnumber,maxperpage,filename)
Dim n
If Totalnumber mod maxperpage=0 then
n= totalnumber \ Maxperpage
Else
n= totalnumber \ Maxperpage+1
End If
Response.Write "<form method=post action=" &filename& ">"
Response.Write "<p align= ' center ' ><font color= ' #000080 ' >>> pagination </font>"
If Page<2 Then
Response.Write "<font color= ' #000080 ' > Home prev </font>"
Else
Response.Write "<a href=" &filename& "?page=1&> home </a>"
Response.Write "<a href=" &filename& "page=" &page-1& "> previous page </a>"
End If
If N-page<1 Then
Response.Write "<font color= ' #000080 ' > Next End </font>"
Else
Response.Write "<a href=" &filename& "page=" & (Page+1)
Response.Write "> Next </a> <a href=" &filename& "? page=" &n& "> Last </a>"
End If
Response.Write "<font color= ' #000080 ' > page: </font><strong><font color=red>" &page& " </font><font color= ' #000080 ' >/&n& </strong> page </font>
Response.Write "<font color= ' #000080 ' > Total <b>" &totalnumber& "</b> Strip record <b>" & maxperpage& "</b> record/Page </font>"
Response.Write "<font color= ' #000080 ' > Goto: </font><input type= ' text ' name= ' page ' size=4 value= ' & page& ">"
Response.Write "<input type=submit name=submit value=go> </span></p>"
End Function
%>