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#
  4. Limiting the retrived results using ODBC on MS access [modified]

Limiting the retrived results using ODBC on MS access [modified]

Scheduled Pinned Locked Moved C#
databasehelptutoriallounge
2 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.
  • C Offline
    C Offline
    cbh_
    wrote on last edited by
    #1

    Hi ;) im trying to Limit the number of results retrived by a Query so for Example i want to retrive the first 30 and then navigate throw the results 30 by 30. the problem in my Query that i cant used the TOP 30 command because im Ordering my results with date then status plus alot of ordering. and this ordering will cause the retrived results to be retrived in a random ID_no order as one of my friends suggested that i use the TOP 30 along with Where Id no > X Order BY Id_no as in the example below. but i think if there is no Command in MS Access or that i dont know it because of my lack of knowledge i will have to order by my Where Criteria along with the TOP 30 command. Another Sol. just popped to my head is to save the results to a Dataset and then using a Table in the Dataset i can just retrived Index based. i guess i will try the Dataset sollution also if there is any better one plz Help. By the way im using ODBC COnnection, OdbcCommand and ODBCDatareader. Thanks in Advance. Example for Retriving by the TOP and Where command: 1) Select TOP 30 A.ID_no , .......etc From A , ......etc Where A.ID_no > 1 Order by ID_no ; 2) Select TOP 30 A.ID_no , .......etc From A , ......etc Where A.ID_no > 30 Order by ID_no ; and i continue like that. Have fun and Stay good ;) -- modified at 4:16 Saturday 25th November, 2006

    E 1 Reply Last reply
    0
    • C cbh_

      Hi ;) im trying to Limit the number of results retrived by a Query so for Example i want to retrive the first 30 and then navigate throw the results 30 by 30. the problem in my Query that i cant used the TOP 30 command because im Ordering my results with date then status plus alot of ordering. and this ordering will cause the retrived results to be retrived in a random ID_no order as one of my friends suggested that i use the TOP 30 along with Where Id no > X Order BY Id_no as in the example below. but i think if there is no Command in MS Access or that i dont know it because of my lack of knowledge i will have to order by my Where Criteria along with the TOP 30 command. Another Sol. just popped to my head is to save the results to a Dataset and then using a Table in the Dataset i can just retrived Index based. i guess i will try the Dataset sollution also if there is any better one plz Help. By the way im using ODBC COnnection, OdbcCommand and ODBCDatareader. Thanks in Advance. Example for Retriving by the TOP and Where command: 1) Select TOP 30 A.ID_no , .......etc From A , ......etc Where A.ID_no > 1 Order by ID_no ; 2) Select TOP 30 A.ID_no , .......etc From A , ......etc Where A.ID_no > 30 Order by ID_no ; and i continue like that. Have fun and Stay good ;) -- modified at 4:16 Saturday 25th November, 2006

      E Offline
      E Offline
      Eduard Keilholz
      wrote on last edited by
      #2

      What control are you using to display the data? I think you can 'throw' all data into the control and enable paging on the display control.

      .: I love it when a plan comes together :. http://www.zonderpunt.nl

      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