Datasnap.DBClient.TCustomClientDataSet.FindNearest
Delphi
procedure FindNearest(const KeyValues: array of const);
C++
void __fastcall FindNearest(const System::TVarRec *KeyValues, const int KeyValues_High);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | Datasnap.DBClient.pas Datasnap.DBClient.hpp |
Datasnap.DBClient | TCustomClientDataSet |
Description
Moves the cursor to the record that most closely matches a specified set of key values.
Call FindNearest to move the cursor to a specific record in a dataset or to the first record in the dataset that matches or is greater than the values specified in the KeyValues
parameter. If there are no records that match or exceed the specified criteria, FindNearest positions the cursor on the last record in the table. The KeyExclusive property controls whether matching values are considered.
KeyValues
contains a comma-delimited array of field values, called a key. If the number of values passed in KeyValues
is less than the number of columns in the index used for the search, the missing values are assumed to be NULL. For C++, KeyValues_Size specifies the index of the last value in the KeyValues
array. This is one less than the number of key values.
Note: FindNearest works only with string data types.