How use post_event in Lazarus (Firebird)
Posted: 28.12.2008, 12:42
1) I put this in my Firebired base;
CREATE TRIGGER "My_table_MSG" FOR "My_table"
ACTIVE AFTER INSERT POSITION 0
AS
beg
POST_EVENT 'my_event';
end
2 I put ZConnection1 and ZIBEventAlerter1 and ZQuery1 on my form
ZConnection1.Contected:=false;
ZConnection1.AutoCommit:=true;
ZIBEventAlerter.Conection:=ZConnection1;
ZIBEventAlerter1.AutoRegister:=False;
ZIBEventAlerter1.Register:=False;
ZIBEventAlerter1.Events[0]:='my_event';
ZConnection1.Contected:=]true;
ZIBEventAlerter1.RegisterEvents;
ZIBEventAlerter1.Register:=True;
and then dead
constructor TIBEventThread.Create(Owner: TZIBEventAlerter;
EventGrp: integer; TermEvent: TNotifyEvent);
begin
inherited Create(True); <-------------------------------------Drop dead
FCancelAlerts := False;
Signal := TSimpleEvent.Create;
Parent := Owner;
EventGroup := EventGrp;
OnTerminate := TermEvent;
Resume;
end;
What is wrong.
Thanks
CREATE TRIGGER "My_table_MSG" FOR "My_table"
ACTIVE AFTER INSERT POSITION 0
AS
beg
POST_EVENT 'my_event';
end
2 I put ZConnection1 and ZIBEventAlerter1 and ZQuery1 on my form
ZConnection1.Contected:=false;
ZConnection1.AutoCommit:=true;
ZIBEventAlerter.Conection:=ZConnection1;
ZIBEventAlerter1.AutoRegister:=False;
ZIBEventAlerter1.Register:=False;
ZIBEventAlerter1.Events[0]:='my_event';
ZConnection1.Contected:=]true;
ZIBEventAlerter1.RegisterEvents;
ZIBEventAlerter1.Register:=True;
and then dead
constructor TIBEventThread.Create(Owner: TZIBEventAlerter;
EventGrp: integer; TermEvent: TNotifyEvent);
begin
inherited Create(True); <-------------------------------------Drop dead
FCancelAlerts := False;
Signal := TSimpleEvent.Create;
Parent := Owner;
EventGroup := EventGrp;
OnTerminate := TermEvent;
Resume;
end;
What is wrong.
Thanks