Problem with (Interbase) Dataset

Hello everyone!
I am using an interbase dataset to select and modify some account data. Well, the select Statement with parameters (datamodule->IBDSet_Accounts->ParamByName("idAccount") = idAccount; ) works fine but as I am trying to arm a ModifySQL statement I get a EDatabase error: Parameter not found.
Is it possible that I have to tell this command (ParamByName) in which SQL String to replace its occurence? Saying, that it might be that it is trying to change the params of the selectSQL. In there -obviously- my params are not present.
Or what might be the reason?

1
2
3
4
5
6
7
datamodule->IBDSet_cuentasComp->Close();
	datamodule->IBDSet_cuentasComp->UnPrepare();
	datamodule->IBDSet_cuentasComp->ModifySQL->Clear();
	datamodule->IBDSet_cuentasComp->ModifySQL->Text = "UPDATE \"cuentasSaldo\" CS SET CS.\"CSAL_CUENTACONAC\" = :cuentaConac'WHERE CS.\"ID_CUENTASSALDO\" IN :idsAccounts ;";	datamodule->IBDSet_Accounts->ParamByName("idsAccounts")->AsString = StrAccounts; // String: (3,5,7) => This line throws error, also if I change this line with the next one
	datamodule->IBDSet_Accounts->ParamByName("accountName")->AsString = treeViewAccount; // Sring: "Name of the Account"
datamodule->IBDSet_Accounts->ExecSQL();
...


The problem here was that :cuentasConac had a ' after the variable (... :cuentaConac'WHERE ...) which caused the problem. The same problem occurs when you just put the opening or closing \" so take care with it. The error message is a bit confusing in this case!
Last edited on
Topic archived. No new replies allowed.