TUniAlerter component & message

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jakouz
Posts: 2
Joined: Tue 04 Dec 2012 08:59

TUniAlerter component & message

Post by jakouz » Tue 04 Dec 2012 09:05

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...

AndreyZ

Re: TUniAlerter component & message

Post by AndreyZ » Tue 04 Dec 2012 10:45

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

jakouz
Posts: 2
Joined: Tue 04 Dec 2012 08:59

Re: TUniAlerter component & message

Post by jakouz » Tue 04 Dec 2012 11:12

ok andrey,
i understand now !

thanks a lot

AndreyZ

Re: TUniAlerter component & message

Post by AndreyZ » Tue 04 Dec 2012 12:30

Feel free to contact us if you have any other questions about UniDAC.

Post Reply