Board index » delphi » Records are not sorting!?!?!!!!!!!!!!!!!!!

Records are not sorting!?!?!!!!!!!!!!!!!!!

The problem I'm having now is that the records are not automatically sorted
when I first bring up the form in my program. I am writing a program for a
client that allows them to manipulate records from an access database by
using the database navigation bar and several populated fields on a fancy
form I created.

All the data comes up perfectly, and I can navigate through the data fine.
The only problem is that the data is NOT comming up sorted. It starts on
record #741 out of like 2 thousand or something.

The nav bar does work the way it should, but it just doesn't start at #1.

The KEY FIELD is an AutoNumber field. It's set as a key field in Delphi
too... I pull these in directly using the TADOTable components, and using
the Datbase DataSource.

Any ideas how I can get it to sort? They're actually SORTED in the database.

Thanks,

--
Todd Jaspers - Programmer
AmeriPath IT - Fort Lauderdale
954-377-3219

 

Re:Records are not sorting!?!?!!!!!!!!!!!!!!!


Use TADODataset instead of TADOTable....table is not efficient.

In the datased you can define CommandText as  'select * form MYTABLE sorted
by MY_COLUMN'. CommandType should be cmdText.

Jan Najvarek

Quote

> All the data comes up perfectly, and I can navigate through the data fine.
> The only problem is that the data is NOT comming up sorted. It starts on
> record #741 out of like 2 thousand or something.

> The nav bar does work the way it should, but it just doesn't start at #1.

> The KEY FIELD is an AutoNumber field. It's set as a key field in Delphi
> too... I pull these in directly using the TADOTable components, and using
> the Datbase DataSource.

Re:Records are not sorting!?!?!!!!!!!!!!!!!!!


Shouldn't that be "ORDER BY", not "SORTED BY"?
-Howard

Re:Records are not sorting!?!?!!!!!!!!!!!!!!!


Quote
>Any ideas how I can get it to sort? They're actually SORTED in the database.

Use an ORDER BY clause in the SQL or set the Sort property.

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads