RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TIBTable.AddIndex Method

Creates a new index for the table.

Pascal
procedure AddIndex(const Name: string; const Fields: string; Options: TIndexOptions; const DescFields: string = '');
C++
__fastcall AddIndex(const AnsiString Name, const AnsiString Fields, TIndexOptions Options, const AnsiString DescFields = '');

Call AddIndex to create a new index for the table associated with a dataset. The index created with this procedure is added to the database table underlying the dataset. Name is the name of the new index. Fields is a semicolon-delimited list of the fields to include in the index. Options is a potentially restricted set attributes for the index. It can specify that an index

  • Represents the primary index for a dataset. (ixPrimary)
  • Contains no duplicate values (ixUnique).
  • Sorts records in descending order (isDescending).

Warning: Attempting to create an index using options that are not applicable to the table raises an exception.
 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!