Prepare Erroring under sql server - execsql does not

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
tonymeadors
Posts: 35
Joined: Wed 28 Feb 2007 17:56

Prepare Erroring under sql server - execsql does not

Post by tonymeadors » Mon 03 Oct 2011 20:27

The PREPARE method below works for IB and Oracle 10g
but gives an elaborate Error message under sql server 2005.


q.sql.add('update pr_master set check_date= :checkdate');
q.ParamByName('checkdate').assqltimestamp := datetimetosqltimestamp(now);
q.Prepare; ///
q.execsql;


The Error text includes:
EMSError with message 'Statement(s)' could not be prepared.
Implicit conversion from data type sql_variant to datetime is not allowed.
Use the CONVERT function to run this query.


The field check_date is defined on the sql server as DATETIME.

NOTE: if I remove the q.prepare; line the q.execsql does
work properly for sql server.

Am I missing something here - quite possible.

Thanks for your incredible help and responsiveness
to all those on this forum "watch." Quite impressive.

Sincerely,
tonyM

AndreyZ

Post by AndreyZ » Wed 05 Oct 2011 13:05

We have reproduced the problem and the investigation of the problem is in progress. We will notify you when we have any results.

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

Post by Dimon » Fri 21 Oct 2011 12:26

We have fixed this problem. This fix will be included in the next UniDAC build.

Post Reply