SQLDataSet Params AsDateTime don't work

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for MySQL in Delphi and C++Builder
Post Reply
ale.capu
Posts: 10
Joined: Fri 21 Nov 2008 17:51

SQLDataSet Params AsDateTime don't work

Post by ale.capu » Tue 25 Nov 2008 09:43

Hello,
I've try to execute a query with a datetime parameter like this:

SQLDataSet.CommandText := "SELECT * FROM test WHERE ins_date>=:par_date"
SQLDataSet.Params['par_date'].AsDateTime := Now();
SQLDataSet.Open;

This raise an exception with "par_date param not found". If I try another param type (for example AsTimeStamp) it works fine.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 25 Nov 2008 15:22

I could not reproduce the problem.
Please supply me the version of DbxMda that you use, and version of your IDE.

Try to use the following code:
SQLDataSet.Params.ParamByName('par_date').AsDateTime := Now();
instead of
SQLDataSet.Params['par_date'].AsDateTime := Now();

Post Reply