Results 1 to 2 of 2

Thread: Accessing db records by links 1-10, 11-20 etc.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Location
    CA
    Posts
    22

    Lightbulb Heres an idea

    Maybe you've tried this and didn't like how it worked but you could try using a sql statement and selecting only the TOP 500 records for 1- 500
    (ie. "SELECT TOP 500 * FROM tbl")

    Then, if the table has an ID that increments, you could get the id for the 500th record and set the 501-1000 sql statement to something like the following:

    "SELECT TOP 500 * FROM tbl WHERE [ID] > 500"

    and so on ...

    This is just an idea .. maybe it will help ..
    --Nick

  2. #2
    New Member
    Join Date
    Feb 2002
    Posts
    1
    NickP Thanks a lot, I think that is what I was looking for! I will have to try it out as soon as I can.

    The table has an incremented id. But there will be gaps in the numbers where entries have been deleted.

    For example:

    table id:
    1
    2
    3
    4
    7
    8
    9
    22
    34
    45

    Now if I used the sql statement : SELECT TOP 10 * FROM tbl

    That should return the records with those ids. Now if I did:
    SELECT TOP 10 * FROM tbl WHERE [ID] > 45 '(the 45 would be a variable)
    That would presumable return the next 10. The only problem with this is how to retrieve the ids where the separations would take place.

    I want the user to be able to select any node and have the correct results displayed as quickly as possible.

    Now if I knew that the ids had no gaps, I could simply find the first ID and last ID and do some math to determine which ids would be the break points.

    Ideally, the user would select how the treeview is to sort the information, by firstname, lastname or title. once the selection is choosen the treeview would be prepared and the break IDs could be identified.

    Thanks...

Posting Permissions

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



Click Here to Expand Forum to Full Width