Icon Locate Method

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

Usage

Use the Locate method to search for a specified row and, if found, make that row the current row. KeyFields is a string containing a semicolon-delimited list of column names on which to search. KeyValues is a variant that specifies the values to match in the key columns. If KeyFields lists a sngle column, KeyValues specifies the value for that column in the desired row. To specify multiple search values, pass a variant array as KeyValues, or construct a variant array on the fly using the VarArrayOf routine. Options is a set that optionally specifies additional search latitude when searching on string columns. If Options contains the loCaseInsensitive setting, then Locate ignores case when comparing CHAR/VARCHAR column values. If Options contains the loPartialKey setting, then Locate allows partial-string matching on CHAR/VARCHAR columns. If Options is an empty set, or if KeyFields does not include any CHAR/VARCHAR columns, Options is ignored.

Locate returns True if it finds a matching row, and makes that row the current row. Otherwise Locate returns False, and the current row does not change. Locate uses the fastest possible method to locate matching rows. If the search columns in KeyFields are indexed and the index is compatible with the specified search options, Locate uses the index. Otherwise Locate uses a brute-force row scan for the search.

Information This method is only used in the context of the descendant TEDBTable, TEDBQuery, TEDBScript, and TEDBStoredProc components.
Image