Sorting a table physically in Delphi

ChuckO picture ChuckO · Feb 23, 2010 · Viewed 7.6k times · Source

Delphi does not seem to like multi-field indexes.

How do I physically sort a a table so that I wind up with a table that has the rows in the desired order?

Example:

mytable.dbf

Field   Field-Name   Field-Type   Size
  0     Payer        Character     35
  1     Payee        Character     35
  2     PayDate      Date
  3     Amount       Currency

I need to produce a table sorted alphabetically by "Payee"+"Payer"

When I tried using an index of "Payee+Payer", I got an error:

"Field Index out of range"

Answer

Mason Wheeler picture Mason Wheeler · Feb 23, 2010

The index field names need to be separated by semicolons, not plus symbols. Try that and it should work.