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 ?
TimeStamp column type - Migrating from Zeos to MyDAC
-
ca_cruiser
- Posts: 13
- Joined: Tue 17 May 2005 12:59
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:
String value from a TDateTimeField field can be read in this way:
Code: Select all
s := c_timestamp14_field.AsString-
ca_cruiser
- Posts: 13
- Joined: Tue 17 May 2005 12:59
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?
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?