CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: sorting

  1. #1
    Join Date
    Jan 2000
    Posts
    1

    sorting

    I have put a dbgrid control on my form and assigned its datasource with the help of a data control. I have
    sorted my table in the backend(access).But the values when assigned to the col in the grid do not appear
    in a sorted order. Is there any way to overcome this problem?
    Any help on the topic would be appreciated.


  2. #2
    Guest

    Re: sorting

    If RecordSource property of DC is a table name then replace it with Select statement containing ORDER BY. Example for Nwind db Customers table:
    SELECT * FROM Customers ORDER BY City.
    If you already have select statement in RecordSource, just add ORDER BY clause.
    Vlad


  3. #3
    Guest

    Re: sorting

    Hi !

    As your back end is Access, develop a query suitable to your requirements. Create a db control on your form and in the
    Record Source property you have to give the name of the query, instead of table. Then all fields in the sorted order ( as
    you desire) could be seen.This I checked practically and it is working well.

    Satya
    Email: [email protected]


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