LocateIndexOrd

<< Click to Display Table of Contents >>

Navigation:  Apollo VCL Components > Apollo VCL Component Reference > TApolloTable > TApolloTable Properties >

LocateIndexOrd

Declaration

property LocateIndexOrd: Integer;

Description

Run-time only. Allows specifying the desired index order to be used internally to calls to the TApolloTable.Locate method. Locate is used internally by DBLookup* controls as well as InfoPower's incremental search and lookup dialog controls. If you know the index order that should be used, setting the LocateIndexOrd property to that index order will improve the performance of these lookup operations.

 

TApolloTable's implementation of TDataSet.Locate utilizes the Seek method when possible, as it is fastest, and the Query method where Seek cannot be used (complex expressions or no active or matching index order).

 

The best way to use this property is to set it inside the OnEnter event of the lookup control, and then reset it to zero (0) in the OnExit event. When the value is zero (the default), TApolloTable attempts to find a best match in the available index orders in order to use Seek instead of Query in processing the Locate logic.

 

If you set this value to anything greater than zero, Apollo does not have to make any assumptions, and will only try an internal Seek using that index order. With LocateIndexOrd set to a non-zero value, if the internal Seek fails, Apollo will not try finding the value using Query as well.

Delphi Example

// With InfoPower's TwwIncrementalSearch control – Use LAST name index

procedure TForm1.wwIncrementalSearch1Enter(Sender: TObject);

begin

 wwApolloTable1.LocateIndexOrd := wwApolloTable1.TagArea('LAST');

end;

 

procedure TForm1.wwIncrementalSearch1Exit(Sender: TObject);

begin

 wwApolloTable1.LocateIndexOrd := 0;

end;

 

See Also

Locate, TagArea