FireDAC.Comp.DataSet.TFDDataSet.SetKey
Delphi
procedure SetKey;
C++
void __fastcall SetKey();
プロパティ
種類 | 可視性 | ソース | ユニット | 親 |
---|---|---|---|---|
procedure function |
public | FireDAC.Comp.DataSet.pas FireDAC.Comp.DataSet.hpp |
FireDAC.Comp.DataSet | TFDDataSet |
説明
キー値入力モードを開始します。
SetKey を使用すると、データセットを dsSetKey
状態にし、検索キー バッファの現在の内容をクリアして、キー フィールド値の入力を可能にすることができます。
EditKey を使用すると、既存のキー フィールド値を最初に消去せずに変更することができます。
例
FDQuery1.IndexFieldNames := 'CUSTOMER_ID;ORDER_DATE';
FDQuery1.SetKey;
FDQuery1.FieldByName('CUSTOMER_ID').AsInteger := 100;
FDQuery1.FieldByName('ORDER_DATE').AsDateTime := EncodeDate(2008, 5, 1);
if not FDQuery1.GotoKey then
ShowMesage('Order is not found');
関連項目
- レコードの検索
- FireDAC.Comp.DataSet.TFDDataSet.EditKey
- FireDAC.Comp.DataSet.TFDDataSet.GotoKey
- FireDAC.Comp.DataSet.TFDDataSet.SetRange
- FireDAC.Comp.DataSet.TFDDataSet.SetRangeEnd
- FireDAC.Comp.DataSet.TFDDataSet.SetRangeStart
- FireDAC.Comp.DataSet.TFDDataSet.IndexName
- FireDAC.Comp.DataSet.TFDDataSet.IndexFieldNames
- FireDAC.Comp.DataSet.TFDDataSet.Indexes