LookupKeyForFields method |
Applies to
TIB_BDataset
Declaration
Function LookupKeyForFields: boolean;
Description
This method is used to locate a record that currently exists in the
Dataset or if it would when all of the records for the Dataset were fetched
from the server. If the record is not in the current buffer then a SELECT
statement is put together according to the current valid Dataset and the
search is performed on the server for this record. If it is not valid then
false will be returned and if it is valid then keys are selected from the
server until the matching one is located sequentially. This happens very
quickly when your key is very narrow. Plus you avoid having to fetch the bulk
of the records like the BDE does in order to perform the search.
If false is returned then the RowNum was not changed from its current position.
If true is returned then the RowNum will be the newly selected row.
First, place the key values in KeyFields and then call this method. If the
record is in the current buffer then it will be moved to it and true will be
returned. Otherwise, false will be returned and the cursor position will
become invalid. The means that BufferRowNum will reflect the row if it was
found.