Page 1 of 1

TUniAlerter component & message

Posted: Tue 04 Dec 2012 09:05
by jakouz
i'm using FireBird 2.5 & BDS 2006
i try to send specific message with TUniAlerter component but it doesn't work.

Code: Select all

//step 1:
procedure TForm1.UniTable1BeforePost(DataSet: TDataSet);
begin
  DataSet.FieldByName('UTI_ID').AsString := FUserLogin;
end;
 
//step 2:
procedure TForm1.UniTable1AfterPost(DataSet: TDataSet);
begin
  UniAlerter1.SendEvent('TR_AFTER_UPD', ' RecNo = ' + IntToStr(DataSet.RecNo) +
     ' UserLogin = ' + DataSet.FieldByName('UTI_ID').AsString); // Sends an event with Name and content Message. 
end;
 
//step3:
procedure TForm1.UniAlerter1Event(Sender: TDAAlerter; const EventName,
  Message: string);
begin
  if (EventName = 'TR_AFTER_UPD') then
    Memo1.Lines.Add(Message + '  ' + IntToStr(Application.Handle));
end;
i catch TR_AFTER_UPD in UniAlerter1Event but Message is empty ! What's wrong...

Re: TUniAlerter component & message

Posted: Tue 04 Dec 2012 10:45
by AndreyZ
Hello,

The point is that events in Firebird are simple notifications, they do not carry any additional data beside the event name itself. That is why, when working with Firebird, you can use only event names. You can find more information about Firebird events in the Firebird Events manual, you can download it at http://www.firebirdsql.org/file/documen ... events.pdf

Re: TUniAlerter component & message

Posted: Tue 04 Dec 2012 11:12
by jakouz
ok andrey,
i understand now !

thanks a lot

Re: TUniAlerter component & message

Posted: Tue 04 Dec 2012 12:30
by AndreyZ
Feel free to contact us if you have any other questions about UniDAC.