API:FireDAC.Comp.Client.TFDCommand.AfterExecute
Delphi
property AfterExecute: TNotifyEvent read FAfterExecute write FAfterExecute;
C++
__property AfterExecute;
プロパティ
種類 | 可視性 | ソース | ユニット | 親 |
---|---|---|---|---|
event | published | FireDAC.Comp.Client.pas FireDAC.Comp.Client.hpp |
FireDAC.Comp.Client | TFDCommand |
説明
このイベントは、コマンドが実行された後に発生します。
FireDAC.Comp.Client.TFDCommand.AfterExecute は FireDAC.Comp.Client.TFDCustomCommand.AfterExecute を継承しています。以下の内容はすべて FireDAC.Comp.Client.TFDCustomCommand.AfterExecute を参照しています。
このイベントは、コマンドが実行された後に発生します。
AfterExecute イベントは、Execute メソッドを呼び出すことによりコマンドが実行されると発生します。
例
procedure TForm1.ADCommand1AfterExecute(ASender: TObject);
begin
if ADCommand1.RowsAffected = -1 then
StatusBar1.SimpleText := 'Ok'
else
case ADCommand1.CommandKind of
skDelete: StatusBar1.SimpleText := Format('%d rows deleted', [ADCommand1.RowsAffected]);
skInsert: StatusBar1.SimpleText := Format('%d rows inserted', [ADCommand1.RowsAffected]);
skUpdate: StatusBar1.SimpleText := Format('%d rows updated', [ADCommand1.RowsAffected]);
else StatusBar1.SimpleText := Format('%d rows affected', [ADCommand1.RowsAffected]);
end;
end;