No value for parameter error

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
lmmolinero
Posts: 1
Joined: Sun 04 Jun 2006 20:30
Location: SPAIN

No value for parameter error

Post by lmmolinero » Sun 04 Jun 2006 20:40

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

Jackson
Posts: 512
Joined: Thu 26 Jan 2006 10:06

Post by Jackson » Mon 05 Jun 2006 08:29

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;

Post Reply