Subject | RE: [IBO] Error with parameters |
---|---|
Author | Support List |
Post date | 2011-11-05T18:22:11Z |
Herbert,
directly accessing the Params[n] array. If you call ParamByName() then it
will prepare the query if you have not already prepared it.
Jason
> Andrei,This is correct and I would add that it is only necessary if you are
>
>
>
> 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;
directly accessing the Params[n] array. If you call ParamByName() then it
will prepare the query if you have not already prepared it.
Jason