LookupKeyForBufferFields method

Applies to
TIB_BDataset

Declaration
Function LookupKeyForBufferFields: boolean;

Description
This method is used to locate a record that currently exists in the buffer 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 that individual record is immediatly fetched and put into the buffer row. BufferRowNum will be -1 in this case. The contents of this row fetched are also put into the temporary buffer so that if its key is ever fetched from the server it will be associated properly. Then it would not have to be fetched again if accessed.

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.