Mapping TIMESTAMP fields as ftDateTime

Mapping TIMESTAMP fields as ftDateTime

Postby 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
nandod
 
Posts: 15
Joined: Mon 29 May 2006 09:03

Postby Plash » Wed 15 Jul 2009 08:49

Our driver does not have such feature.
Plash
Devart Team
 
Posts: 2844
Joined: Wed 10 May 2006 07:09

Postby 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
nandod
 
Posts: 15
Joined: Mon 29 May 2006 09:03

Postby 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.
Plash
Devart Team
 
Posts: 2844
Joined: Wed 10 May 2006 07:09

Postby 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.
nandod
 
Posts: 15
Joined: Mon 29 May 2006 09:03


Return to dbExpress driver for InterBase & Firebird