Executing a Search with Find Methods
Go Up to Using Indexes to Search for Records
The Find methods do the same thing as the Goto methods, except that you do not need to explicitly put the dataset in dsSetKey state to specify the key field values on which to search.
To execute a search using Find methods:
- Specify the index to use for the search. This is the same index that sorts the records in the dataset. To specify the index, use the IndexName or IndexFieldNames property.
- Open the dataset.
- Search for and move to the first or nearest record with FindKey or FindNearest. Both methods take a single parameter, a comma-delimited list of field values, where each value corresponds to an indexed column in the underlying table.
Note: FindNearest can only be used for string fields.
See Also
- Executing a Search with Goto Methods
- Specifying the Current Record After a Successful Search
- Repeating or Extending a Search
- Searching On Partial Keys
- Datasnap.DBClient.TCustomClientDataSet.FindKey
- Bde.DBTables.TTable.FindKey
- Datasnap.DBClient.TCustomClientDataSet.FindNearest
- Bde.DBTables.TTable.FindNearest