Paging Recordsets

Results 1 to 2 of 2

Thread: Paging Recordsets

  1. #1
    Join Date
    Dec 1969

    Default Paging Recordsets

    I am performing a search on an access database and I&#039;m returning the results. I want the results to have a number next to each result ( 1. result, 2. result, 3. result, etc.). I don&#039;t want the number to come from the database becuase each row will be unique and if I delete a row, that will leave a missing number when I display my recordset ( 1. result, 2. result, 4. result, etc.). <BR><BR>I want the numbers to be generated when I&#039;m doing the loop for the recordset. Perhaps in a counter or something? However, when I add a counter to my recordset and I set the pagesize to 5, it will display the first page fine but when I hit the next button, it restarts at the number 1. again. I want the number sequence to pick up at 6. and so on. <BR><BR>Can anyone help with this? Thank you.

  2. #2
    Join Date
    Dec 1969

    Default RE: Paging Recordsets

    Hi,<BR><BR>So why don&#039;t you simply do this:<BR><BR>While NOT RS.EOF &#039;or your first 5 records<BR>Response.Write counterValue & " " & RS("theproduct") & "<BR>"<BR>counter = counter + 1<BR>RS.Next<BR>WEND<BR><BR>...<BR><BR>Now out of the loop, your counter had a value... attach that to the "NEXT RECORDS" button for a querystring type... such as:<BR><BR>&#060;a href"nextrecords.asp?counter=&#060;%=counter%&#062 ;"&#062;More results&#060;/a&#062;<BR><BR>Then you simply call a Request.QueryString("counter") and obtain the counter&#039;s last state (should be 5 in my case).. go back into the loop again.. and so on.<BR><BR>Hope this helped ya,<BR><BR><BR>Vadim C.

Posting Permissions

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