ADO Recordset sorting problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nash2love
    New Member
    • Sep 2007
    • 2

    ADO Recordset sorting problem

    Hi

    I am new to V.B . currently i am using MS-Access as backend and V.B 6.0 as front end. now i am creating one table in MS-Access with fields SName and SAge and i entered 15 records with out any order.
    now i am trying to access those records using ADO recordset.its working fine.. but it shows last 14 records in first position and first record in the last position. so what i have to do to access all the records in the same order as i entered in Access.

    Thanks in Advance...

    Regards
    Nash.B
  • BlackMustard
    New Member
    • Aug 2007
    • 88

    #2
    Originally posted by nash2love
    Hi

    I am new to V.B . currently i am using MS-Access as backend and V.B 6.0 as front end. now i am creating one table in MS-Access with fields SName and SAge and i entered 15 records with out any order.
    now i am trying to access those records using ADO recordset.its working fine.. but it shows last 14 records in first position and first record in the last position. so what i have to do to access all the records in the same order as i entered in Access.

    Thanks in Advance...

    Regards
    Nash.B
    it's pretty hard to know exactly what you should do without knowing what sql statement you used to access the data, but i would suggest adding " ORDER BY Id ASC" at the end of it to order it by the database id. this requires, of course, that you have a column in your database called "Id" with data type "AutoNumber " and set as Primary Key.

    Comment

    • nash2love
      New Member
      • Sep 2007
      • 2

      #3
      Thanks .... now i am using the Autonumber field and its working...

      Regards
      Nash

      Comment

      Working...