CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2005
    Posts
    4

    Unhappy Change in Order of records

    Hi,

    I am executing a query from Vb using ADO / Informix drivers to Informix server.

    If I am running the same query on informix console I am getting records in a particular oder but If I am executing the same query from VB then the recordset that I am receving is coming in a seperate order than Informix.

    Can anyone tell me how to resolve this problem.

    Thanks & Regards,

    Kedar

  2. #2
    Join Date
    Jun 2005
    Posts
    1,255

    Re: Change in Order of records

    The order will stay the same if you use the "ORDER BY" clause at the end of your query.
    Code:
    SELECT Thing_ID, Thing_Name, Thing_Date, Thing_etc
    FROM Tb_Thing
    WHERE Thing_col7 > 'foo'
    ORDER BY Thing_date, Thing_Name
    You can add the direction of the sort with the ASC and DESC keywords for ascending and descending order,
    e.g. SELECT ... ORDER BY Thing_Date DESC, Thing_Name ASC

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

Featured