Delphi Database, Delphi Components from ComponentAce
Products Download Order Contact us
TABSTable.AddIndex
TABSTable
Top 


Creates a new index for the table.

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

Description
Call AddIndex to create a new index for an existing table associated with a dataset component. The index created with this procedure is added to the database table corresponding to the dataset component.

Name is the name of a new index.

Fields is a String value containing the field or fields which are used to serve as a base for
the new index. If more than one field is used, separate the field names in the list with semi-colons.

Options is a set of attributes for the index. The Options parameter may contain any, multiple, or none of the TIndexOptions constants: ixPrimary, ixDescending, and ixCaseInsensitive. See the topic for the TIndexOptions type for definitions of individual constants and for implications of using them.

DescFields is a string containing a list of field names, separated by semi-colons. DescFields specifies fields with descending ordering for the new index. Fields in the index definition but not in the DescFields list use the default ascending ordering. It is possible that a single index can have fields using both ascending and descending ordering.

CaseInsFields is a string containing a list of field names, separated by semi-colons. CaseInsFields specifies case insensitive fields for the new index. Fields in the index definition but not in the CaseInsFields list use the default case sensivity option. It is possible that a single index can have fields using both case sensitive and case insensitive options.

ABSTable1.AddIndex('MostPaid', 'CustNo;SaleDate;AmountPaid', [ixCaseInsensitive], 'SaleDate;AmountPaid');

        © 2003 - 2024 ComponentAce  | .net zip component | barcode for .net | delphi zip component | delphi database Nov 23, 2024