How to access DateTime fields as TDateTimeField

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
esasse
Posts: 47
Joined: Tue 27 Nov 2007 19:08
Location: Brazil

How to access DateTime fields as TDateTimeField

Post by esasse » Mon 19 Apr 2010 13:53

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?

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

Post by Dimon » Mon 19 Apr 2010 14:16

Please, try to use the SQL Native Client provider. For this you should set the TSQLConnection.VendorLib property to 'sqlncli'.

esasse
Posts: 47
Joined: Tue 27 Nov 2007 19:08
Location: Brazil

Post by esasse » Mon 19 Apr 2010 15:27

Didn't work.

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

Post by Dimon » Tue 20 Apr 2010 08:06

DbxSda maps datetime fields to TSQLTimeStampField because it must be compartible with standard Borland driver. Starting with Delphi 2007 dbExpress supports only TSQLTimeStamp fields.

esasse
Posts: 47
Joined: Tue 27 Nov 2007 19:08
Location: Brazil

Post by esasse » Tue 20 Apr 2010 18:00

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.

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

Post by Dimon » Wed 21 Apr 2010 06:49

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.

Post Reply