Invalid Parameter / HY000 Error using MSSQL and Integer param

Invalid Parameter / HY000 Error using MSSQL and Integer param

Post by csymingto » Thu, 21 Oct 2004 23:01:35


Background: D7, dbexpress, MSSQL 2000. I'm trying to convert an
existing app from BDE/Interbase to dbexpress/MSSQL 2000.

I've searched through the newsgroups and tried all the suggestions by
I'm still stumped. I have several dbexpress datasets with a query

SELECT * from MyTable where MyTablesField = :MyParam

The MyTablesField and MyParam are of Integer types. (Those aren't the
real names :) )

The errors are reproducible by trying to run the query via the client
or by trying to add fields to the fields editor for the dataset.
These are errors I get:

"dbExpress Error: [0x0009]: Invalid Parameter
SQL-Server Error:
Multiple-Step OLE-DB operation generated errors. Check OLE-DB status
value, if available. No work was done."


"dbExpress Error: [0x0009]: Invalid Parameter"


"SQL Server Error: SQL State HY000, SQL Error Code: 0
Invalid input parameter values. Check the status values for errors"

I've read a lot of postings regarding a bug in the MS driver. Here
are the things I've tried to solve this.

1. Installed the D7 service pack. It seems to have installed fine
except that when I check the Delphi Help..About.., it says version 7.0
and not 7.1.

2. Installed the service pack 3a for MSSQL 2000 that should have the
latest MDAC components and drivers.

3. I tried using core labs trial version of the driver and connection

4. I tried the Ramesh driver on the BDN download site.

5. I've gone over the table definition to see if there could be other
issues. The field that I'm querying on is defined in MSSQL as an
integer value and has been indexed.

7. I've fiddled with the query to search by other fields in the table
and it works just fine.

8. I've checked other queries in my application and all of the ones
that look up based on an integer fields have the same error message.

None of the above seems to have worked. What could I be missing? Any
suggestions would be appreciated. Thanks!