Paging with ADO and GetRows() - would you ever do

Results 1 to 3 of 3

Thread: Paging with ADO and GetRows() - would you ever do

  1. #1
    Join Date
    Dec 1969

    Default Paging with ADO and GetRows() - would you ever do

    Dear all,<BR><BR>I have seen many articles about paging either with GetRows(), ADO or stored procedures. Each has its specific benefits. Great.<BR><BR>I got to wondering whether there would ever be the need to use both ADO and GetRows() for paging? For instance, if I had lots of products in a database (000&#039;s), even if I tried to limit the size of the recordset by filtering in SQL on say, &#039;ProductCategory&#039;, there may be a hundred products in a category. Using GetRows() this would mean that I temporarily create a large-ish recordset and then a 100 element array. Excluding Stored Procedures for now, would this be considered efficient? My thinking is that if I chose to display my 100 products 5 per page, that is 20 potential times that an entire recordset is retrieved from the database to only display 5 products from the array (based on the method given in this 4Guys article.)<BR><BR>I am thinking that it might be better to use the Recordset PageSize, CacheSize and AbsolutePage Properties to only hit the database for the exact number & page of records required, and to use GetRows() to ensure good performance/efficincy and to ensure the Recordset object is released as soon as possible.<BR><BR>I welcome your advice. Have I gone completely mad in trying to do this? Has anyone done it already? Would anyone else want to?! I&#039;d like to see code for a working example, just to satisfy my curiosity!<BR><BR>Thanks!

  2. #2
    Join Date
    Dec 1969

    Default RE: Paging with ADO and GetRows() - would you ever

    I dont know why you use GetRows() to page data...<BR>The best way I know of is using cursors<BR>and the AbsolutePage value in ADO.<BR>No GetRows needed... and I Page through db&#039;s with 80,000 + records<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default rs.move

    I use a combination of getrows and rs.move to page my data.. I figure out what page Im on and multiply it by recordsperpage and then use rs.move to find the record that im on then I use rs.getrows(recordsperpage) and list em out. I use a readonly cursor. Its pretty fast. I havent benchmarked it though I would be interested in seeing how fast it really is.

Posting Permissions

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