Page 1 of 1
TimeStamp column type - Migrating from Zeos to MyDAC
Posted: Wed 27 Dec 2006 19:52
by ca_cruiser
Hello,
I'm swapping out data access components from Zeos to MyDAC. The MySql column type TimeStamp(14) is returned as follows:
Zeos : TStringField
MyDac: TDateTime
How can I get the MyDAC components to treat the MySql TimeStamp column to be returned as a TStringField ?
Posted: Thu 28 Dec 2006 13:19
by Antaeus
There are two ways to solve this problem. The first way is to set the FieldsAsString option of TMyQuery to True. In this case every field in DataSet will be described as TStringField. The second way is to cast this field on the server to string. For more information about the DATE_FORMAT function see the
MySQL Reference Manual.
String value from a TDateTimeField field can be read in this way:
Posted: Thu 28 Dec 2006 13:51
by ca_cruiser
Sorry, but I should have given more details.
I understand I can handle this programmatically .AsString but my problem is that when using 3rd party components (like RaveReports), it directly reads the Table and Field as TString under Zeos and TDateTime under MyDAC.
Can this only be addressed by acquiring the source code and making modifications?
Posted: Fri 29 Dec 2006 08:30
by Antaeus
Yes, such behaviour can be achieved only with source code of MyDAC.