Page 1 of 1

Is DateTime2 datatype supported?

Posted: Wed 14 Sep 2011 09:47
by Mark de Waal
Hello,

At the moment we use the standard dbExpress driver for MS SQL Server, but are looking for alternatives, so I am experimenting with the trial version of dbxsda 4.80/5.00beta

Does dbxsda 4.80/5.00beta support the DateTime2 datatype for parameters and fields?

In the RAD Studio 2010 IDE I have a TSQLConnection set up and connected to a TSQLStoredProc.
When I fill the storedprocname in the object inspector, the parameters are automatically defined, unless the stored procedure has a DateTime2 parameter; in that case no parameters are defined (I guess due to an exception, but none is shown)

When I add all fields to a TSQLStoredProc, a DateTime2 column in the stored proc resultset is defined as a TWideStringField.

Is DateTime2 supported? Am I doing something wrong?

TIA
Mark de Waal

Posted: Wed 14 Sep 2011 15:45
by AndreyZ
Hello,

To solve the problem, you should use SQL Native Client provider. For this, you should set the TSQLConnection.VendorLib property to sqlncli.dll . After this all datetime2 columns will be mapped to TSQLTimeStampField.

Posted: Thu 15 Sep 2011 08:44
by Mark de Waal
Hello AndreyZ,

Thanks for your reply. I tried it and it indeed solves the TField problem, but the parameter problem still remains.

When the stored procedure has a DataTime parameter, a ftTimeStamp parameter is automatically created when I set the procedure name. When the stored procedure has a DataTime2 parameter, no parameters are created.

When I manually add a ftTimeStamp (input)parameter, the stored procedure can be executed though and the parameter has the correct value. Note: it can even be set to values that are outside the range of the DateTime datatype, like 'january 1 1000', so the driver seems to work OK

Is this a bug or am I still doing something wrong?
BTW I use SQL Server 2008R2; client library sqlncli10.dll (ver 2009.100.1600.1)

Posted: Thu 15 Sep 2011 12:24
by AndreyZ
Thank you for the information. We have reproduced this problem and fixed it. This fix will be included in the next dbExpress driver for SQL Server build. We are going to release dbExpress driver for SQL Server this week.

Posted: Thu 15 Sep 2011 13:02
by Mark de Waal
Thanks!