Subject Re: [IBO]Component writing - exposing OnPrepareSQL
Author Thomas Steinmaurer
> I have a component which internally contains an IB_Cursor and exposes and
> SQL property. This works fine.
> Now I want to expose the OnPrepareSQL event which I'm having problems with.
> I have a private declaration
> FOnPrepareSQL: TIB_StatementEvent;
> and a published
> property OnPrepareSQL: TIB_StatementEvent read FOnPrepareSQL write
> FOnPrepareSQL;
> I've set up a procedure
> procedure PrepareSQL(Sender: TObject);
> to fire off the OnPrepareSQL with
> if Assigned(FOnPrepareSQL) then FOnPrepareSQL(Sender);
> But I cant work out how to get the internal IB_Cursor.OnPerpareSQL connected
> to my procedure.
>
> Maybe the whole approach is wrong - any suggestions?

Usually, you do that in the constructor of your component with something
along the line:

...
begin
FCursor.OnPrepareSQL := PrepareSQL;
end


If FCursor is the name of your internal IB_Cursor component.


--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com
My blog:
http://blog.upscene.com/thomas/
50% DISCOUNT on all our LogManager products until Oct. 7th, 2008
HURRY UP: http://www.upscene.com/lm_party_promo.htm