Page 1 of 1

How to access DateTime fields as TDateTimeField

Posted: Mon 19 Apr 2010 13:53
by esasse
I'm trying to have the same code base for Firebird and MSSQL. I'm using Devart's driver to access both, but in MSSQL, Datetime fields are read as TSQLTimeStampFields instead of TDateTimeFields.

How can I solve this?

Posted: Mon 19 Apr 2010 14:16
by Dimon
Please, try to use the SQL Native Client provider. For this you should set the TSQLConnection.VendorLib property to 'sqlncli'.

Posted: Mon 19 Apr 2010 15:27
by esasse
Didn't work.

Posted: Tue 20 Apr 2010 08:06
by Dimon
DbxSda maps datetime fields to TSQLTimeStampField because it must be compartible with standard Borland driver. Starting with Delphi 2007 dbExpress supports only TSQLTimeStamp fields.

Posted: Tue 20 Apr 2010 18:00
by esasse
Ok, forget it, my problem is that in Firebird I use a lot of date fields, that are not supported by SQL 2005, so there I've created datetime fields.

What I have to do is convert my date/time fields in Firebird to timestamp fields.

Thanks.

Posted: Wed 21 Apr 2010 06:49
by Dimon
DbxIda maps DATE fields to TDateField, and TIMESTAMP fields to TSQLTimeStampField. DbxSda maps DATETIME fields to TSQLTimeStampField. DbxIda doesn't map any fileds to TDateTimeField, because dbExpress supports only TSQLTimeStamp fields.
You can find more detailed information about it in Readme.html.