I have a sql server table with 52 fields. Using a TAdoQuery talking to SQl Server 2000 I am setting the values using ParamByName. I have found that if I leave all the fields in I get an error on one of the lines such as :
Query.Parameters.ParamByName('MyField').Value := MyField;
the error is :
"Application uses a value of the wrong type for the current operation"
"incorrect syntax near @P38"
If I remove the lines talking to some fields the error goes away. It is not specific to particlar fields only the number. This makes no sense to me as there are 8kb per row allowed in sql server.
None of the fields are blobs, there are 364 kb :
4 uniqueidentifier (16 x 4 = 64)
23 int (23 * 4 = 92)
1 ntext (16)
24 float (24* 8 = 192)
If I remove (not from the database) any 12 of the float value lines it works fine, if I remove 11 of them I get the above error.
Can anyone shed any light on this mystery?
Thanks a lot,