Delphi Database, Delphi Components from ComponentAce
Products Download Order Contact us
Sorting Records with Indexes
Previous  Top  Next

An index determines the display order of records in a table. Typically, records appear in physical order. This default behavior does not require application intervention. If you want a different sort order, however, you must specify either

·An alternate index for TABSTable component via IndexName or IndexFieldNames property.  
·A list of columns on which to sort with TABSQuery component via ORDER BY clause.  

An index could be created by AddIndex method of TABSTable component.


ABSTable1.IndexName := 'idxPrimary';

ABSTable1.IndexFieldNames := 'LastName;FirstName'

ABSQuery1.SQL.Test := 'SELECT * FROM employee ORDER BY FirstName';
        © 2003 - 2024 ComponentAce  | .net zip component | barcode for .net | delphi zip component | delphi database Jun 16, 2024