Use a pagination class CPaging
Copy codeThe Code is as follows: Class CPaging
Public RS 'recordset object
Public mark' pointer label
Private sSize 'number of entries per page
Total number of Private sTotal records
Private sPage 'current page number
Private sCount 'total page number
Private Sub Class_Initialize
SSize = 20
SPage = 1
SCount = 1
End Sub
Private Sub Class_Terminate
Closeobj RS
End Sub
'Number of entries per page
Property Let Size (Value)
SSize = Value
End Property
Property Get Size
Size = sSize
End Property
'Current page number
Property Let Page (Value)
If Not IsNumeric (Value) Then
SPage = 1
Else
SPage = Value
End If
End Property
Property Get Page
If (sPage-1) * sSize> sTotal Then
If sTotal Mod sSize = 0 Then
Page = Total \ sSize
Else
Page = Total \ sSize + 1
End If
ElseIf sPage <1 Then
Page = 1
Else
Page = sPage
End If
End Property
'Total page number
Property Get Count
If sTotal Mod sSize = 0 Then
Count = sTotal \ sSize
Else
Count = sTotal \ sSize + 1
End If
End Property
'Total number of records
Property Get Total ()
Total = sTotal
End Property
Public Function Open (Byval SQLString)
Try DB. Openquery (RS, SQLString)
STotal = RS. RecordCount
End Function
End Class
The following is the call pageCopy codeThe Code is as follows: Dim Products
Set Products = New CPaging
With Products
. Size = 15' number of entries per page
. Page = PageNum current Page
End
Try Products. Open (ListSQL)
If Products. RS. Bof and Products. RS. Eof then
Response. Write ("<TR> <TD colspan = 8> search for records not found </TD> </TR> ")
Else
Dim I
I = 0
Products. RS. Move (Products. Page-1) * Products. Size
Do While Not Products. RS. Eof
Response. write ("<TR onmouseup = MouseUp (this); onmousedown = MouseDown (this); onmouseover = MouseOver (this); onclick = Click (this ); onmouseout = MouseOut (this);> "& vbCrLf)
Response. Write ("<TD align = middle nowrap>" & Products. RS ("ProductsClassName") & "</TD>" & vbCrLf)
Response. Write ("<TD align = left nowrap>" & Products. RS ("ProductsName") & "</TD>" & vbCrLf)
Response. Write ("</TR>" & vbCrLf)
I = I + 1
If I> = Products. Size Then Exit Do
Products. RS. MoveNext
Loop
End If
When we see rows 8th, we seem to have a glimpse of the. net shadow-namespace?