FireDAC.Comp.DataSet.TFDDataSet.SetRange
Delphi
procedure SetRange(const AStartValues, AEndValues: array of const;
AStartExclusive: Boolean = False; AEndExclusive: Boolean = False);
C++
void __fastcall SetRange(const System::TVarRec *AStartValues, const System::NativeInt AStartValues_High, const System::TVarRec *AEndValues, const System::NativeInt AEndValues_High, bool AStartExclusive = false, bool AEndExclusive = false);
Contents
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | FireDAC.Comp.DataSet.pas FireDAC.Comp.DataSet.hpp |
FireDAC.Comp.DataSet | TFDDataSet |
Description
Sets the starting and ending values of a range and applies them.
Use SetRange to specify the beginning and ending range values for the dataset and apply the range.
AStartValues
sets the starting range of the indexed field values. AEndValues
sets the ending range of the indexed fields values. SetRange performs the following steps:
- Puts the dataset into the
dsSetKey
state. - Erases any previously specified starting range values and ending range values.
- Sets the start and end range values.
- Applies the range to the dataset.
If the current dataset record is within a new range, then it becomes current after a call to SetRange. Otherwise, the current position is set to the first record in the range.
If either AStartValues
or AEndValues
has fewer elements than the number of fields in the current index, then the remaining entries are set to NULL.
Example
FDQuery1.IndexFieldNames := 'CUST_NO';
FDQuery1.SetRange([100], [200]);