Board index » delphi » please help me about paradox table key's problem

please help me about paradox table key's problem

I have created a paradox table with a primary key. But I want to
use a dbgrid to display the table with the inserted order not
the key's order? I can't find any way to solve it. If you konw
please tell me how to do it.Thank you!

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!

 

Re:please help me about paradox table key's problem


yuanweihua

You could add another field to your table to hold/store the record's
sequence no and define a secondary index on that field. When showing
your dbgrid your app should set the table's IndexName property to this
new secondary index.

The new field could be either of autoincrement or (typically) longint
type. In the first case a new (and unique) value is created by the BDE
automatically each time a new record is appended (I personally use this
method without any problems, but problems are reported especially in
multiuser environments). In the latter case (which could be useful if
you've got lots of master/detail related tables) you have to keep track
of your recordID yourself.

Regards

Peter

Sent via Deja.com http://www.deja.com/
Before you buy.

Re:please help me about paradox table key's problem


Mr Peter:Thanks a lot for your answer.But then how to keep the
track of recordId? There's any ease way to do that?

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!

Other Threads