Subject | TIB_DSQL Parameter error message |
---|---|
Author | Kevin Stanton |
Post date | 2004-10-04T14:59:21Z |
Greetings,
I've recently just started using TIB_DSQL for retrieving a product
description (thanks to Helen, I wasn't aware you could retrieve field values
with this low-overhead component).
The code to get the product description is this:
If qryGetProdDesc.Active then
qryGetProdDesc.Active := False;
If NOT qryGetProdDesc.Prepared then
qryGetProdDesc.Prepare;
qryGetProdDesc.ParamByName('ProdID').AsString := Field.AsString;
qryGetProdDesc.Active := True;
ProdDesc := qryGetProdDesc.FieldByName('ProdDesc').AsString;
If qryGetProdDesc.Active then
qryGetProdDesc.Active := False;
If qryGetProdDesc.Prepared then // <--- had to add this
qryGetProdDesc.Unprepare; // <--- to avoid below
error
I had to add the last test and unprepare the TIB_DSQL otherwise I get:
ISC Error Code: 335544569
Dynamic SQL Error
SQL Error code = -804
SQLDA missing or incorrect version, or incorrect number/type of variables.
Is there a way to update the parameters and reactivate w/out unprepare and
re-prepare?
Thanks,
Kevin
I've recently just started using TIB_DSQL for retrieving a product
description (thanks to Helen, I wasn't aware you could retrieve field values
with this low-overhead component).
The code to get the product description is this:
If qryGetProdDesc.Active then
qryGetProdDesc.Active := False;
If NOT qryGetProdDesc.Prepared then
qryGetProdDesc.Prepare;
qryGetProdDesc.ParamByName('ProdID').AsString := Field.AsString;
qryGetProdDesc.Active := True;
ProdDesc := qryGetProdDesc.FieldByName('ProdDesc').AsString;
If qryGetProdDesc.Active then
qryGetProdDesc.Active := False;
If qryGetProdDesc.Prepared then // <--- had to add this
qryGetProdDesc.Unprepare; // <--- to avoid below
error
I had to add the last test and unprepare the TIB_DSQL otherwise I get:
ISC Error Code: 335544569
Dynamic SQL Error
SQL Error code = -804
SQLDA missing or incorrect version, or incorrect number/type of variables.
Is there a way to update the parameters and reactivate w/out unprepare and
re-prepare?
Thanks,
Kevin