Overload OnPostError in TMyQuery

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
saidus
Posts: 78
Joined: Wed 26 Oct 2005 09:54
Location: Algeria

Overload OnPostError in TMyQuery

Post by saidus » Sat 08 Mar 2008 07:57

Hi All ...
I inherite from TMyQuery a Component called TClientMyQuery to encapsulate Client Table Fields in I've Overrided all methode (DoBefore..,DoAfter.. )events with success but I'm wonderring how to Override the OnPostError Event ..
What is the methode that Fire this Event..
or what is the mecanisme to Override it ...
Help me Please ...

saidus
Posts: 78
Joined: Wed 26 Oct 2005 09:54
Location: Algeria

Post by saidus » Sat 08 Mar 2008 12:34

Thanks // I think i got it
I've created a procedure that intercept the application excption then exchange that handler with this Procedure
like this

Code: Select all

procedure TClientQuery.InterceptException(Sender:TObject;E:Exeption);
begin
  .....
end;
......
procedure TClientQuery.DoBeforePost(Sender:TObject)
begin
   inherited BeforePost;
   Application.OnException := InterceptException;
end;
and it works

Post Reply