Subject RE: [IBO] Error with parameters
Author Support List
Herbert,

> Andrei,
>
>
>
> you have to prepare the query before you are able to assign parameter
> values.
>
> After having assigned the SQL
>
> qryTmp.Text := 'SELECT ...';
>
> insert
>
> (You can omit the next line as you know that your qryTmp is definitely not
>
> prepared.)
>
> if not qryTmp.Prepared then
>
> qryTmp.Prepare;
>
> Now qryTmp.Params are available and values can be set.
>
> qryTmp.Params[0].AsInteger :=
> qryXYZ.FieldByName(aName).AsInteger;
>
> qryTmp.Open;

This is correct and I would add that it is only necessary if you are
directly accessing the Params[n] array. If you call ParamByName() then it
will prepare the query if you have not already prepared it.

Jason