Data.DB.TDataSet.Locate

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Locate(const KeyFields: string; const KeyValues: Variant;  Options: TLocateOptions): Boolean; virtual;

C++

virtual bool __fastcall Locate(const System::UnicodeString KeyFields, const System::Variant &KeyValues, TLocateOptions Options);

Properties

Type Visibility Source Unit Parent
function public
Data.DB.pas
Data.DB.hpp
Data.DB TDataSet

Description

Implements a virtual method for searching a dataset for a specified record and making it the active record.

This function:

Checks whether the dataset is unidirectional, and if so, raises an EDatabaseError exception.

Returns false, indicating that a matching record was not found and the active record was not changed.

Descendant classes that are not unidirectional override this method so that it locates the record where the fields identified by the semicolon-separated list of fields in KeyFields have the values specified by the Variant or Variant array KeyValues. Options indicates whether the search is case insensitive and whether partial matches are supported. Locate returns true if a record is found that matches the specified criteria and that record is now active.

See Also