FireDAC.Comp.Client.TFDEventAlerter

From RAD Studio API Documentation
Jump to: navigation, search

FireDAC.Comp.Client.TFDCustomEventAlerterFireDAC.Stan.Intf.TFDComponentSystem.Classes.TComponentSystem.Classes.TPersistentSystem.TObjectTFDEventAlerter

Delphi

TFDEventAlerter = class(TFDCustomEventAlerter)

C++

class PASCALIMPLEMENTATION TFDEventAlerter : public TFDCustomEventAlerter

Properties

Type Visibility Source Unit Parent
class public
FireDAC.Comp.Client.pas
FireDAC.Comp.Client.hpp
FireDAC.Comp.Client FireDAC.Comp.Client

Description

The class responsible for handling the database event notifications.

Use the TFDEventAlerter class to handle the database event notifications.

The general behavior of the events is DBMS-specific and TFDEventAlerter provides a unified way for handling them.

Example

FDEventAlerter1.Options.Kind := 'DBMS_ALERT';
FDEventAlerter1.Names.Text := 'Customers';
FDEventAlerter1.Options.Synchronize := True;
FDEventAlerter1.Options.Timeout := 10000;
FDEventAlerter1.OnAlter := DoAlert;
FDEventAlerter1.OnTimeout := DoTimeout;
FDEventAlerter1.Active := True;
........

procedure TForm1.DoAlert(ASender: TFDCustomEventAlerter;
  const AEventName: String; const AArgument: Variant);
begin
  if CompareText(AEventName, 'Customers') = 0 then
    qryCustomers.Refresh;
end;

procedure TForm1.DoTimeout(ASender: TObject);
begin
  qryCustomers.Refresh;
end;

See Also