AnyDAC
ContentsIndexHome
Example 1
ADEventAlerter1.Names.Text := 'Customers';
ADEventAlerter1.Options.Kind := 'DBMS_ALERT';
ADEventAlerter1.Options.Synchronize := True;
ADEventAlerter1.Options.Timeout := 10000;
ADEventAlerter1.OnAlter := DoAlert;
ADEventAlerter1.OnTimeout := DoTimeout;
ADEventAlerter1.Active := True;
........

procedure TForm1.DoAlert(ASender: TADCustomEventAlerter;
  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;