Advantage TDataSet Descendant
Sets a scope for the given index order.
type TAdsScopeOptions = ( soTOP, soBOTTOM );
procedure AdsSetScope( eScopeOption : TAdsScopeOptions; strScope : String );
Indicates which scope value to set.
Scope value to set.
AdsSetScope sets a scope for the index to limit the number of records visible. For example, setting a soTOP scope of "M" on an index on a character field will make an AdsGotoTop call on this index go to the first key greater than or equal to "M". A soBOTTOM scope will make the indicated value the last one visible in the index order. For example, if AdsSetScope is called with soBOTTOM and "Smith" on a lastname index, the last Smith on an AdsGotoBottom call will be the current record. Set the scope for top and bottom to the same value to only view records with the given scope value from the index.
It is not necessary to have both top and bottom scopes set at the same time. The Advantage Client Engine does not check that the soTOP and soBOTTOM scopes are not mutually exclusive. When setting scopes on descending indexes, the soTOP scope will be set at the logical top of the index (largest key) and the soBOTTOM is at the logical bottom (smallest key).
To set a scope on indexes built on date, time, or timestamp fields, the date and time values must be formatted as text. The date should be formatted according to DateFormat. For example, to set a scope on a date index, an application might pass "2/25/1997" as the scope value. To set a scope on a timestamp index, the value could be "2/25/1997 3:25pm".
AdsTable1.SetRange( [‘Adams’], [‘Smith’] );