Board index » cppbuilder » Revert TDBGrid sorting and AUTOINC primary key field

Revert TDBGrid sorting and AUTOINC primary key field


2004-02-29 05:15:24 PM
cppbuilder88
Hi,
I want to revert sorting of a TDBGrid connected to a database
table.
Actually my record are sorted like this
1
2
3
.
.
.
n
And I want to display these record like this
n
.
.
.
3
2
1
How could I do this ?
Thank you for your answers.
Patrick
 
 

Re:Revert TDBGrid sorting and AUTOINC primary key field

Hello,
The TDBGrid shows the records in the data set order, so you need change the record order in the data set, even using a TQuery with an "ORDER BY" clause or creating a table index on the reverse field order an set up the TTable::IndexName property to the name you gave to the created index.
HTH
Jayme.
"FAURE Patrick" < XXXX@XXXXX.COM >wrote in message news:4041adac$ XXXX@XXXXX.COM ...
Quote

Hi,

I want to revert sorting of a TDBGrid connected to a database
table.

Actually my record are sorted like this
1
2
3
.
.
.
n
And I want to display these record like this
n
.
.
.
3
2
1
How could I do this ?
Thank you for your answers.

Patrick
 

Re:Revert TDBGrid sorting and AUTOINC primary key field

Hi,
Thank you for your answer, I do it and this works fine.
Patrick
"Jayme Jeffman Filho" < XXXX@XXXXX.COM >wrote:
Quote
Hello,

The TDBGrid shows the records in the data set order, so you need change =
the record order in the data set, even using a TQuery with an "ORDER BY" =
clause or creating a table index on the reverse field order an set up =
the TTable::IndexName property to the name you gave to the created =
index.

HTH

Jayme.

 

{smallsort}