Locate
This generic search method sets the current record to be the first row matching a specified set of search criteria. By using the Locate method we can look for values of one or more fields, passed in a variant array.
The next code puts the Locate method to work finding the first record that contains the string 'Zoom' in the Name field. If the call to Locate returns True - the record is found and is set to be the current one.
|
AdoTable1.Locate('Name,,,Zoom',[]); | |
|
{■■■or---} | |
|
var ffield, fvalue: string; opts : TLocateOptions; | |
|
ffield := 'Name'; fvalue := 'zoom'; opts := [loCaseInsensitive]; | |
|
if not AdoTable1.Locate(ffield, fvalue, ShowMessage(fvalue + ' not found in ' |
opts) then + ffield); |
Post a comment