TurboDB VCL/CLX Component Library
TTdbTable.AddIndex
TTdbTable
Top 


Creates a new index for the table.

procedure AddIndex(const Name, Fields: String; Options: TIndexOptions, const DescFields: String='');

Description
Call AddIndex to create an index the table. An index can be used to show the records in a given order or to search faster for certain records.
Name is the file name of the new index, e.g. MyTableByName. The file of the new index will be called MyTableByName.ind.
Fields is the list of tables column to use for the index separated by semi-colons.
Options is a set of index options. The options applicable for TurboDB indexes are:
ixExpression   Fields contains an TurboDB expression to calculate the index entries
ixUnique   Each index entry can occur only once
DescFields is a list of fields in Fields that are to be sorted in descending order.

Remarks
This method is equivalent to TTable.AddIndex.