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
How use post_event in Lazarus (Firebird)
Moderators: gto, cipto_kh, EgonHugeist
Supposing you are using Firebrid 2.1, and you have set it as driver in ZConnection1, open
..\src\component\ZIBEventAlerter.pas
and add
uses
SysUtils, Classes, Math,
{$IFDEF MSWINDOWS}
Windows,
{$ENDIF}
{$IFDEF LINUX}
Libc,
{$ENDIF}
ZDbcInterbase6, ZPlainInterbaseDriver, ZConnection, ZDbcIntfs,
ZPlainInterbase5, ZPlainInterbase6, ZPlainFirebird10, ZPlainFirebird15, ZPlainFirebird20, ZPlainFirebird21, ZPlainFirebirdInterbaseConstants;
procedure TIBEventThread.RegisterEvents;
if Parent.Connection.Protocol='interbase-5' then
sib_event_block := Tsib_event_block(ZPlainInterbase5.isc_event_block)
else if Parent.Connection.Protocol='interbase-6' then
sib_event_block := Tsib_event_block(ZPlainInterbase6.isc_event_block)
else if Parent.Connection.Protocol='firebird-1.0' then
sib_event_block := Tsib_event_block(ZPlainFirebird10.isc_event_block)
else if Parent.Connection.Protocol='firebird-1.5' then
sib_event_block := Tsib_event_block(ZPlainFirebird15.isc_event_block)
else if Parent.Connection.Protocol='firebirdd-1.5' then
sib_event_block := Tsib_event_block(ZPlainFirebird15.isc_event_block)
else if Parent.Connection.Protocol='firebird-2.0' then
sib_event_block := Tsib_event_block(ZPlainFirebird20.isc_event_block)
else if Parent.Connection.Protocol='firebirdd-2.0' then
sib_event_block := Tsib_event_block(ZPlainFirebird20.isc_event_block)
else if Parent.Connection.Protocol='firebird-2.1' then
sib_event_block := Tsib_event_block(ZPlainFirebird21.isc_event_block)
else if Parent.Connection.Protocol='firebirdd-2.1' then
sib_event_block := Tsib_event_block(ZPlainFirebird21.isc_event_block)
..\src\component\ZIBEventAlerter.pas
and add
uses
SysUtils, Classes, Math,
{$IFDEF MSWINDOWS}
Windows,
{$ENDIF}
{$IFDEF LINUX}
Libc,
{$ENDIF}
ZDbcInterbase6, ZPlainInterbaseDriver, ZConnection, ZDbcIntfs,
ZPlainInterbase5, ZPlainInterbase6, ZPlainFirebird10, ZPlainFirebird15, ZPlainFirebird20, ZPlainFirebird21, ZPlainFirebirdInterbaseConstants;
procedure TIBEventThread.RegisterEvents;
if Parent.Connection.Protocol='interbase-5' then
sib_event_block := Tsib_event_block(ZPlainInterbase5.isc_event_block)
else if Parent.Connection.Protocol='interbase-6' then
sib_event_block := Tsib_event_block(ZPlainInterbase6.isc_event_block)
else if Parent.Connection.Protocol='firebird-1.0' then
sib_event_block := Tsib_event_block(ZPlainFirebird10.isc_event_block)
else if Parent.Connection.Protocol='firebird-1.5' then
sib_event_block := Tsib_event_block(ZPlainFirebird15.isc_event_block)
else if Parent.Connection.Protocol='firebirdd-1.5' then
sib_event_block := Tsib_event_block(ZPlainFirebird15.isc_event_block)
else if Parent.Connection.Protocol='firebird-2.0' then
sib_event_block := Tsib_event_block(ZPlainFirebird20.isc_event_block)
else if Parent.Connection.Protocol='firebirdd-2.0' then
sib_event_block := Tsib_event_block(ZPlainFirebird20.isc_event_block)
else if Parent.Connection.Protocol='firebird-2.1' then
sib_event_block := Tsib_event_block(ZPlainFirebird21.isc_event_block)
else if Parent.Connection.Protocol='firebirdd-2.1' then
sib_event_block := Tsib_event_block(ZPlainFirebird21.isc_event_block)
I have same problem with TZIBEventAlerter, it die in same place in ZIBEventAlerter.pas and throw RunError(232).. I use lastest version of ZEOS from SVN (7.0.0) installed in lazarus on linux.mdaems wrote:Did this change to testing branch. Will be added to 6.6-patches branch soon.
Fortuna1,
Did this solve the problem?
Mark