Board index » delphi » TTable-Sorting with Lookup-Fields as Sorting Index????

TTable-Sorting with Lookup-Fields as Sorting Index????

When you use a TTable Object and a DBGrid to display the Paradox-data
normally you have to use secondary indexes to sort the data. But when there
Lookup-Fields in this Table I have not found any way to sort the data
depending on this lookup-fields.
Is there any possibility to sort the data not using Index-Files but inside
the TTable Object ?????

I know that I could use TQuery-Components but Request-Life can not be set to
true when using multiple tables (cross referencing).

Thank you very mutch for response

Bernd Hartl, Germany

eMails:  Ha...@IBK-GmbH.COM

 

Re:TTable-Sorting with Lookup-Fields as Sorting Index????


On Wed, 21 Jul 1999 17:03:32 +0200, "Bernd Hartl" <nos...@nospam.com>
wrote:

Quote
>When you use a TTable Object and a DBGrid to display the Paradox-data
>normally you have to use secondary indexes to sort the data. But when there
>Lookup-Fields in this Table I have not found any way to sort the data
>depending on this lookup-fields.
>Is there any possibility to sort the data not using Index-Files but inside
>the TTable Object ?????

>I know that I could use TQuery-Components but Request-Life can not be set to
>true when using multiple tables (cross referencing).

>Thank you very mutch for response

>Bernd Hartl, Germany

>eMails:  Ha...@IBK-GmbH.COM

There is no direct way to sort on a lookup field. What I've done is
create a memory structure from this table (assuming it's not too big)
and then sort in memory. I can then display in a StringTable. The
other alternative is to create a temporary table which now includes
the lookup field as a regular field and index on the lookup field
after creating it from the main table.

Steve F (Team B)

Other Threads