FireDAC.Comp.Client.TFDCustomCommand.AfterExecute

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type: event
Visibility: public
Source:
FireDAC.Comp.Client.pas
FireDAC.Comp.Client.hpp
Unit: FireDAC.Comp.Client
Parent: TFDCustomCommand

Delphi

property AfterExecute: TNotifyEvent read FAfterExecute write FAfterExecute;

C++

__property System::Classes::TNotifyEvent AfterExecute = {read=FAfterExecute, write=FAfterExecute};

Description

This event fires after the command is executed.

The AfterExecute event fires after the command is executed by calling the Execute method.

Example

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;

See Also