[Overview][Constants][Types][Classes][Procedures and functions][Index] |
Search for a record and return matching values.
Source position: db.pas line 1323
public function TDataSet.Lookup( |
const KeyFields: String; |
const KeyValues: Variant; |
const ResultFields: String |
):Variant; virtual; |
KeyFields |
|
Semicolon-separated list of fieldnames to locate record. |
KeyValues |
|
Values for keyfields to locate record with. |
ResultFields |
|
Semicolon-separated list of fieldnames whose values must be returned. |
Value(s) of ResultFields.
Lookup always returns False in TDataset. Descendents of TDataset can override this method to call TDataset.Locate to locate the record with fields KeyFields matching KeyValues and then to return the values of the fields in ResultFields. If ResultFields contains more than one fieldname (separated by semicolons), then the function returns an array. If there is only 1 fieldname, the value is returned directly.
If the dataset is unidirectional, then a EDatabaseError exception will be raised.
|
Locate a record based on some key values |
lazarus-ccr.sourceforge.net |