FireDAC.Comp.DataSet.TFDDataSet.KeyFieldCount
提供: RAD Studio API Documentation
Delphi
property KeyFieldCount: Integer read GetKeyFieldCount write SetKeyFieldCount;
C++
__property int KeyFieldCount = {read=GetKeyFieldCount, write=SetKeyFieldCount, nodefault};
プロパティ
| 種類 | 可視性 | ソース | ユニット | 親 |
|---|---|---|---|---|
| property | public | FireDAC.Comp.DataSet.pas FireDAC.Comp.DataSet.hpp |
FireDAC.Comp.DataSet | TFDDataSet |
説明
キー検索または範囲のセットアップに使用する、インデックス付きフィールドの値の数を制御します。
KeyFieldCount で、キー検索または範囲のセットアップに使用する、インデックス付きフィールドの値の数を取得または設定します。デフォルト値は、インデックス付きフィールドの総数です。
KeyFieldCount はインデックス付きフィールドの総数(IndexFieldCount)以下であることが必要です。指定した場合は、FireDAC は、IndexFieldCount のフィールドではなく、最初から KeyFieldCount のインデックス付きフィールドを使用して検索します。KeyFieldCount を設定できるのは、dsSetKeyMode の場合だけです。
このプロパティが意味があるのは、式ではないインデックスに対してだけです。
例
//Example 1 FDQuery1.IndexFieldNames := 'EmployeeID;CustomerID;SellDate'; FDQuery1.SetKey; FDQuery1.KeyFieldCount := 2; FDQuery1.FieldByName('EmployeeID').AsInteger := 100; FDQuery1.FieldByName('CustomerID').AsInteger := 200; FDQuery1.GotoKey; //Example 2 FDQuery1.IndexFieldNames := 'EmployeeID;CustomerID;SellDate'; FDQuery1.SetRangeStart; FDQuery1.KeyFieldCount := 1; FDQuery1.FieldByName('EmployeeID').AsInteger := 100; FDQuery1.SetRangeEnd; FDQuery1.KeyFieldCount := 1; FDQuery1.FieldByName('EmployeeID').AsInteger := 100; FDQuery1.ApplyRange;