Subject | RE: [IBO]Component writing - exposing OnPrepareSQL |
---|---|
Author | Paul Hope |
Post date | 2008-10-07T16:50Z |
Thankyou Thomas
That is what I did but it didnt work because I had defined
procedure PrepareSQL(Sender: TObject)
instead of
procedure PrepareSQL(Sender: TIB_Statement)
Given your confirmation I looked again and found the error ;-)
Regards
Paul
That is what I did but it didnt work because I had defined
procedure PrepareSQL(Sender: TObject)
instead of
procedure PrepareSQL(Sender: TIB_Statement)
Given your confirmation I looked again and found the error ;-)
Regards
Paul
> > 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