Subject | RES: [IBO] Better place to change Params |
---|---|
Author | Claudio Kloss |
Post date | 2001-02-27T21:00:33Z |
Thanks Jason. It works perfect now.
Also I want to say that help are showing in almost every event of
TIB_Statement, only this description: "General statement notification
event". There is plan to improve this? Or am I looking in the wrong place?
By the way, did you receive the files I send to you?
Claudio F. Kloss
MicroLight Informática Ltda.
Juiz de Fora - MG - Brazil
-----Mensagem original-----
De: Jason Wharton [mailto:jwharton@...]
Enviada em: terça-feira, 27 de fevereiro de 2001 17:17
Para: IBObjects@yahoogroups.com
Assunto: 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
Also I want to say that help are showing in almost every event of
TIB_Statement, only this description: "General statement notification
event". There is plan to improve this? Or am I looking in the wrong place?
By the way, did you receive the files I send to you?
Claudio F. Kloss
MicroLight Informática Ltda.
Juiz de Fora - MG - Brazil
-----Mensagem original-----
De: Jason Wharton [mailto:jwharton@...]
Enviada em: terça-feira, 27 de fevereiro de 2001 17:17
Para: IBObjects@yahoogroups.com
Assunto: 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