TurboDB VCL Component Library



Previous  Top  Next

Creates a new index for the table.

Delphi syntax:

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

C++ syntax:

void __fastcall AddIndex(const AnsiString Name, const AnsiString Fields, Db::TIndexOptions Options, const AnsiString DescFields = "");


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 name of the new index.

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.


This method is equivalent to TTable.AddIndex.