Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Display data in pages

Display data in pages

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialdatabasecomhelpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Ivan Cachicatari
    wrote on last edited by
    #1

    Hi everyone, I have a CDaoDatabase connection, I open a CDaoRecordset with this. The problem is: I have more of 30000 records stored in tables. How to get portion of this data.? for example: query1 : first 1000 records query2 : next 1000 records (1001 to 2000) query# :... I'm using the RDBMS MSDE2000. The statement "select TOP ..." only retrieve the first records. Thanks in advance. Ivan Cachicatari www.latindevelopers.com

    C 1 Reply Last reply
    0
    • I Ivan Cachicatari

      Hi everyone, I have a CDaoDatabase connection, I open a CDaoRecordset with this. The problem is: I have more of 30000 records stored in tables. How to get portion of this data.? for example: query1 : first 1000 records query2 : next 1000 records (1001 to 2000) query# :... I'm using the RDBMS MSDE2000. The statement "select TOP ..." only retrieve the first records. Thanks in advance. Ivan Cachicatari www.latindevelopers.com

      C Offline
      C Offline
      Chris Losinger
      wrote on last edited by
      #2

      here's one way: 1. create a temp table with all the fields in your recordset and an identity int column. 2. put all the results from your query into that table (INSERT INTO...) 3. SELECT from that temp table WHERE ID BETWEEN 1001 AND 2000 or, if your original recordset has an identity column, you can just use that. Cleek | Image Toolkits | Thumbnail maker

      I 1 Reply Last reply
      0
      • C Chris Losinger

        here's one way: 1. create a temp table with all the fields in your recordset and an identity int column. 2. put all the results from your query into that table (INSERT INTO...) 3. SELECT from that temp table WHERE ID BETWEEN 1001 AND 2000 or, if your original recordset has an identity column, you can just use that. Cleek | Image Toolkits | Thumbnail maker

        I Offline
        I Offline
        Ivan Cachicatari
        wrote on last edited by
        #3

        Thanks for you post. This option downs the performance of the database server. I have a Pentium III 550Mhz on Win98 and MSDE2000 as data server. You Known another method to do this. Ivan Cachicatari www.latindevelopers.com

        C 1 Reply Last reply
        0
        • I Ivan Cachicatari

          Thanks for you post. This option downs the performance of the database server. I have a Pentium III 550Mhz on Win98 and MSDE2000 as data server. You Known another method to do this. Ivan Cachicatari www.latindevelopers.com

          C Offline
          C Offline
          Chris Losinger
          wrote on last edited by
          #4

          Ivan Cachicatari wrote: You Known another method to do this sorry, i don't. i don't know of any Microsoft SQL iimplementations that allow it, but with MySQL you can use "SELECT * FROM whatever LIMIT low,high". with SQLServer and Access, i've always had to use the temp table+identitiy field trick Cleek | Image Toolkits | Thumbnail maker

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups