I have a big project that uses Corelabs SQLServer dbexpress driver in Delphi 7. I'm trying to port it to D2007 and am stuck.
I paid for an upgrade to version 4 (for D2007) of the DLL, which will arrive in the next day or so I guess, but in the meantime I'm trying to make this work with the trial DLL. I've also tried to make this work with the version 3 DLL, to no avail.
I have a lot of code where I use this kind of approach;
Code: Select all
with dmMain.qryWorker do
begin
SQL.Text:='select col_1, col_2, col_3 from mytable where field1=:pValue1 and field2=:pValue2';
ParamByName('pValue1').AsInteger:=whatever;
ParamByName('pValue2').AsString:=whatever;
Open;
//etc
end;
Moving to D2007, this all works fine. UNLESS one of the parameters happens to be a datetime, at which point I get a "no value found for parameter 'blah' " message.
eg, in the example above, if I used
Code: Select all
ParamByName('pValue2').AsDateTime:=Now;
I've tried setting the 'bound' property to be true. I've tried explicitly telling it that the parameter's datatype is ftDateTime etc.... but it doesn't work.
Has something changed in dBExpress? Everything is the same (query, database, remote server) but either D2007 does something new/different with datetime parameters, or the DLL driver does - but either way I'm stuck.
Am I doing something 'wrong' for DBExpress (my background is usually ADO so I could be approaching this wrong)? I'm really puzzled because this works in D7 with the 3.0.3.0 version of the dbexpsda.dll file, and I didn't expect something as fundamental as passing parameters to the database to have changed that much.
Has anyone else encountered this problem? Due to the vague/possibly misleading nature of the error message you get back, it's been quite frustrating trying to google for similar reports.
If this is a Delphi issue, not a DBExpress issue, then please accept my apologies.