Subject Re: [IBO] tib_grid display on query rerun
Author Thomas Steinmaurer
Explicitely prepare your query in the OnPrepareSQL event when using
parameterized queries.

e.g. in the OnPrepareSQL event:

SQLWhereItems.Add('ID = :P_ID');
....
Prepare;

Or if you don't use parameterized queries, then simply build
your WHERE clause without calling TIB_Query.Prepare.

for example:
SQLWhereItems.Add(Format('ID = %s', [CustId]));

Best Regards
Thomas Steinmaurer
IB LogManager 2.0 - The Logging Tool for Interbase/Firebird
http://www.iblogmanager.com

""stanw1950"" <stanw@...> schrieb im Newsbeitrag
news:a27do6+gjug@......
> Thanks Thomas. That fixes the display problem. I also set up a
> parameter in the OnPrepareSQL
> (SQLWhereItems.Add('ID = :P_ID');).
>
> I wrote the code as
> if active then begin
> InvalidateSQL;
> ParamByName('P_ID').AsInteger := CustId;
> Refresh;
> else...//query not open
>
> I occasionally get an AV when it executes the ParamByName statement.
> The AV appears to occur in the IBA_Column.IMP unit in the
> TIB_ColumnInteger.SetValue function. I can probably live with it with
> a silent exception, but do you think my code is correct? Thanks.
>
>
>
> --- In IBObjects@y..., "Thomas Steinmaurer" <ts@i...> wrote:
> > If your query is already open, then you can execute:
> >
> > qry.InvalidateSQL;
> > qry.Refresh;
> >
> > This will fire the OnPrepareSQL event and refreshes your
> > dataset with the newly set WHERE clause
> >
> > Best Regards
> > Thomas Steinmaurer
> > IB LogManager 2.0 - The Logging Tool for Interbase/Firebird
> > http://www.iblogmanager.com
> >
>
>
>
>
>
___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
> without the need for BDE, ODBC or any other layer.
>
___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
> keyword-searchable FAQ, community code contributions and more !
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>