RAD Studio |  |

Creating an Index with IndexFieldNames
See Also
Collapse All

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:

Copy Code

    PhoneTable.IndexFieldNames := 'LastName;FirstName';

Copy Code

    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.
See Also

Obtaining Information About Indexes

Specifying an Index with IndexName

IndexFieldNames

IndexFieldNames

IndexFieldNames

IndexFieldNames

IndexFieldNames

IndexFieldNames

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