Data.SqlExpr.TCustomSQLDataSet.Locate

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

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

C++

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

Properties

Type Visibility Source Unit Parent
function public
Data.SqlExpr.pas
Data.SqlExpr.hpp
Data.SqlExpr TCustomSQLDataSet

Description

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

The Locate method checks whether the dataset is unidirectional, and if so, raises an EDatabaseError exception.

Descendant classes that are not unidirectional override Locate 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. The Options parameter indicates whether the search is case insensitive and whether partial matches are supported.

Locate returns True if a record that matches the specified criteria and is now active is found, and False otherwise.

See Also