API:FireDAC.Comp.Client.TFDCommand.AfterExecute

De RAD Studio API Documentation

Delphi

property AfterExecute: TNotifyEvent read FAfterExecute write FAfterExecute;

C++

__property AfterExecute;

Propriétés

Type Visibilité  Source Unité  Parent
event published
FireDAC.Comp.Client.pas
FireDAC.Comp.Client.hpp
FireDAC.Comp.Client TFDCommand

Description

Cet événement se déclenche après l'exécution de la commande. {{#multireplace:FireDAC.Comp.Client.TFDCommand.AfterExecute|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}} hérite de {{#multireplace:FireDAC.Comp.Client.TFDCustomCommand.AfterExecute|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}}. Tout le contenu en-dessous de cette ligne se réfère à {{#multireplace:FireDAC.Comp.Client.TFDCustomCommand.AfterExecute|H21=!|H25=%|H28=(|H29=)|H2A=*|H2B=+|H2F=/|H3C=<|H3D==|H3E=>|H5B=[|H5D=]|H5E=^|H7C=|}}.

Cet événement se déclenche après l'exécution de la commande.

L'événement AfterExecute se déclenche après l'exécution de la commande en appelant la méthode Execute.

Exemple

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;

Voir aussi