Subject Better place to change Params
Author Claudio Kloss
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