Subject Re: [IBO] Better place to change Params
Author Luiz Alves
Another alternative is:

If you can use this query without parameters on sql statement, you could
code onPrepareSql event with SQLWhereItems to filter that rows.

I use it all the time.

Luiz.

----- Original Message -----
From: Jason Wharton <jwharton@...>
To: <IBObjects@yahoogroups.com>
Sent: Tuesday, February 27, 2001 5:16 PM
Subject: Re: [IBO] Better place to change Params


> You don't have to change parameters there. This is during the prepare
phase
> which means your parameter objects may not be setup yet. That's why that
> string list is used but I intend that to be for internal use mostly.
>
> I suggest that you use the BeforeExecute event and use the
> aramByName( 'adfd' ).AsXXXX to set the values.
>
> HTH,
> Jason Wharton
> CPS - Mesa AZ
> http://www.ibobjects.com
>
>
> ----- Original Message -----
> From: "Claudio Kloss" <ckloss@...>
> To: "IBObjects" <IBObjects@yahoogroups.com>
> Sent: Tuesday, February 27, 2001 1:13 PM
> Subject: [IBO] Better place to change Params
>
>
> > Where is the better place to change parameters in a parameterized query?
> I'm
> > changing them in OnPrepareSQL. This is what I've done.
> >
> > procedure TfrmCadEntrada.QueryAfterScroll(IB_Dataset: TIB_Dataset);
> > begin
> > with dm.qryCFOP do begin
> > InvalidateSQL;
> > Refresh;
> > end;
> > end;
> >
> > procedure TdmCadEntradas.qryCFOPPrepareSQL(Sender: TIB_Statement);
> > begin
> > if not Assigned(CadEntradas.frmCadEntrada) then Exit;
> > with CadEntradas.frmCadEntrada do begin
> > qryCFOP.ParamValues['Abrangencia']:=VerificaAbrangencia(
> > Query.FieldValues['UFEmp'],
> >
> > Query.FieldValues['UFFnc'] );
> > end;
> > end;
> >
> > On the event PrepareSQL, the param is being updated but after "Refresh"
in
> > AfterScroll event, the param shows the old value and so I'm not getting
> the
> > expected results.
> >
> > Am I doing something wrong?
> >
> > Claudio F. Kloss
> > MicroLight Informática Ltda.
> > Juiz de Fora - MG - Brazil
> >
> >
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
> >
> >
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>