Page 1 of 1

No value for parameter error

Posted: Sun 04 Jun 2006 20:40
by lmmolinero
I'm using Delphi 7, and when I have an insert or update query with parameters, and some parameter have a NULL value, I wrote this code:

parameter.clear;
parameter.bound:=true;

and got an error message "no value for parameter XXX"

Any suggestions?

Thanks,

Luis Miguel Molinero
Las Rozas - Madrid SPAIN

Posted: Mon 05 Jun 2006 08:29
by Jackson
This is dbExpress limitation. You have to set parameter data type.
For example:

Code: Select all

SQLQuery.ParamByName('p2').Clear;
SQLQuery.ParamByName('p2').DataType := ftString;
SQLQuery.ParamByName('p2').Bound := True;