Friday, April 13, 2012

Paging in Classic ASP

ConnectionString ="DSN=DataSourceName"
SQLS = "SELECT * FROM TableName"

Set PRS = Server.CreateObject("ADODB.Recordset")
PRS.CursorLocation = 3 ' adUseClient
PRS.PageSize = 10
PRS.Open SQLS, ConnectionString

CurrentPage = 1
PRS.AbsolutePage = CurrentPage
Do While Not ( PRS.Eof Or PRS.AbsolutePage <> CurrentPage )
    PRS.MoveNext
Loop
PRS.Close
set PRS = nothing

References:
http://support.microsoft.com/kb/202125
http://www.codeproject.com/Articles/619/ADO-Recordset-Paging-in-ASP

No comments:

Post a Comment