Paging through Recordsets too slow

Results 1 to 3 of 3

Thread: Paging through Recordsets too slow

  1. #1
    Join Date
    Dec 1969

    Default Paging through Recordsets too slow

    I use the attached code to page through record sets in a database <BR>(Page x of 10 [Prev] [Next]). The code works like a champ when the database has relatively few records to deal with. However, once the DB has a thousand or so records the code becomes _very_ slow. Can any one offer suggestions on improving my technique? Is there a better page to page through large databases?<BR><BR> Dim cnnOBJ<BR> Set cnnOBJ = Server.CreateObject("ADODB.Connection")<BR> cnnOBJ.ConnectionString = Application("ConnectionString")<BR> cnnOBJ.Open<BR><BR> Dim rsOBJ<BR> Set rsOBJ = Server.CreateObject("ADODB.Recordset")<BR> rsOBJ.CacheSize = 9<BR> rsOBJ.CursorLocation = adUseClient<BR> rsOBJ.Open sqlQuery, cnnObj, adOpenForwardOnly, adLockReadOnly<BR> rsOBJ.PageSize = 9<BR> rsOBJ.AbsolutePage = lngCurrentPage<BR><BR> &#039[start table]<BR><BR> For intPager = 1 to 9<BR> &#039[display table row and cells]<BR> rsOBJ.Movenext<BR> If rsOBJ.EOF Then Exit For<BR> Next<BR><BR> &#039[end table]<BR><BR> rsOBJ.Close<BR> Set rsOBJ = Nothing<BR><BR> cnnOBJ.Close<BR> Set cnnOBJ = Nothing

  2. #2
    Curtis Guest

    Default RE: Paging through Recordsets too slow

    is there a specific reason why you have to page through?

  3. #3
    Join Date
    Dec 1969

    Default RE: Paging through Recordsets too slow

    It&#039s the CursorLocation that&#039s causing the problem - adUseClient causes the entire recordset to be returned from the database immediately. Setting CacheSize has no effect with a client-cursor.<BR><BR>Try using a server-side cursor.<BR><BR>Dunc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts