RAD Studio
ContentsIndex
PreviousUpNext
Creating an Index with IndexFieldNames

If there is no defined index that implements the sort order you want, you can create a pseudo-index using the IndexFieldNames property.

Note: IndexName and IndexFieldNames are mutually exclusive. Setting one property clears values set for the other. For information about IndexName, see Specifying an index with IndexName.
The value of IndexFieldNames is a string. To specify a sort order, list each column name to use in the order it should be used, and delimit the names with semicolons. Sorting is by ascending order only. Case-sensitivity of the sort depends on the capabilities of your server. See your server documentation for more information. 

The following code sets the sort order for PhoneTable based on LastName, then FirstName:

PhoneTable.IndexFieldNames := 'LastName;FirstName';

 

PhoneTable->IndexFieldNames = "LastName;FirstName";

Note: If you use IndexFieldNames on Paradox and dBASE tables, the dataset attempts to find an index that uses the columns you specify. If it cannot find such an index, it raises an exception.

Obtaining Information About Indexes 

Specifying an Index with IndexName 

IndexFieldNames 

IndexFieldNames 

IndexFieldNames 

IndexFieldNames 

IndexFieldNames 

IndexFieldNames

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!