EPUB | CHM | PDF

TMySQLTable.Methods.GotoKey

Top Previous Next

Moves the cursor to a record specified by the current key.

Syntax:

function GotoKey: Boolean;

Description:

Use GotoKey to move to a record specified by key values assigned with previous calls to SetKey or EditKey and actual search values indicated in the Fields property.

If GotoKey finds a matching record, it positions the cursor on the record and returns True. Otherwise the current cursor position remains unchanged, and GotoKey returns False.

Delphi 7 and prior has poor support for int64 values in variant type. This means that you'll be unable to use Locate and similar methods with such fields. Lookup fields and master-detail tables will not work properly too because of their dependence on Locate method. Please update your IDE to BDS 2006 (or later) or don't use BIGINT and UNSIGNED INT datatypes for keys and indexes if you need to use them in lookup fields. Also you can't use variant-style properties (FieldValuesAsVariant and so on) with such fields.

See also: Example: EditKey, GotoKey