Mon, 04 Jul 2005 20:03:14 GMT
MySQL ODBC 3.51 and passing a date as parameter to a query
MySQL ODBC 3.51 and passing a date as parameter to a query Hi! I'm working ond Delphi 6 and BDE 5.2 to access a MySQL-Server via MySQL ODBC 3.51. Whenever I need to set a parameter of type date to a query (see code below), I get an EDBEngineError "Operation nicht anwendbar". I tried to trace the cause of this exception and found, that it is raised by DbiQSetParams() called in SetQueryParams(). DbiQSetParams() returns an error number 10756. I've set all date formats in the system settings, bde settings and DATEFORMAT-variable to the correct format (yyyy-mm-dd). What else can I do to find and solve this problem? Any ideas? bye, Tobias qry := TQuery.Create(nil); qry.DatabaseName := 'TEST'; qry.SQL.Add('INSERT INTO test_tbl (my_date) VALUES (:param1)'); qry.Params[0].AsDate := Date; try qry.ExecSQL; //Exception gets raised here finally qry.Free; end; PS: Setting the date as '2003-01-01' in the SQL-Statement works perfectly, but I need to use parameters in the UpdateSQL-component!
|