Hallo,
klar, eigenlich logisch:
Delphi-Quellcode:
Form1.OnActivate:
.
.
.
if IBEvents1.Registered = False then
begin
IBEvents1.Database:= DataModule2.IBDatabase1;
IBEvents1.Events.Add('UPDATE ERFOLGREICH');
IBEvents1.Registered:= True;
end;
.
.
.
procedure TForm1.IBEvents1EventAlert(Sender: TObject; EventName: String;
EventCount: Integer; var CancelAlerts: Boolean);
begin
Application.MessageBox('Das ist ein Test','Hinweis',36);
end;
und jetzt noch zum Beenden:
Delphi-Quellcode:
Form1.OnClose;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
If DataModule2.IBTransaction1.Active = True then DataModule2.IBTransaction1.Commit;
IBEvents1.UnRegisterEvents;
if IBEvents1.Registered = True then IBEvents1.Registered:= False;
DataModule2.IBDatabase1.Close;
end;
[edit=Sharky]Delphi-Tags gesetzt Mfg, Sharky[/edit]