Mapping TIMESTAMP fields as ftDateTime

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for InterBase & Firebird in Delphi and C++Builder
Post Reply
nandod
Posts: 15
Joined: Mon 29 May 2006 09:03

Mapping TIMESTAMP fields as ftDateTime

Post by nandod » Tue 14 Jul 2009 09:04

Hello.
Is there a way to get TIMESTAMP fields mapped as ftDateTime instead of ftSQLTimeStamp? It is crucial for some backward compatibility issues I am having.

Thanks
--
Nando

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 15 Jul 2009 08:49

Our driver does not have such feature.

nandod
Posts: 15
Joined: Mon 29 May 2006 09:03

Post by nandod » Wed 15 Jul 2009 08:52

I am stuck; what could I do instead? Would you say it's feasible if I implement it myself in the driver (got the source)?
Would you say that writing a specialized TField could work?
Other ideas?

Thanks
--
Nando

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 16 Jul 2009 11:09

Starting with Delphi 2007, dbExpress does not support TDateTimeField at all. Maybe you should replace TDateTimeField with TSQLTimeStampField in your code using a program with the Replace in Files feature (like Visual Studio).

I think you can change the field type mapping in the driver source.

nandod
Posts: 15
Joined: Mon 29 May 2006 09:03

Post by nandod » Thu 16 Jul 2009 11:21

Thanks, I did it by overriding InternalInitFieldDefs, GetFieldClass and GetFieldData, and creating a custom field type. I convert timestamps on the fly and treat them as datetimes. Works fine, even in D2007.
Can't change the application code - it should remain compatible with the BDE.

Post Reply