Page 1 of 1

Exception when changing field type from DateTime to Date

Posted: Tue 18 Jan 2005 15:10
by Guest
Hello,

I'm having this issue (FYI it's working well with zeoslib comp).

1: Create a simple table with a TDateTime field.
2: Create a simple delphi project with a grid connected with this table
Retreive at design time the fields.
Compile and launch the project, insert a row, go into the DateTimeField, put a value and post.... (it will works). Close the project.

3: Now, with your favorite DBA tool,open the mysql table and change the DateTime field to an DateField.

4: Launch the project again, insert a new row and go into the DateTimeField.... you will raise an exception (0.0 is not a correct time).

As said before, I don't have this behaviour with other mysql compatible components. It is possible to change this behaviour ?

Thank you very much.

Stephan

Re: Exception when changing field type from DateTime to Date

Posted: Wed 19 Jan 2005 09:45
by Ikar
MyDAC doesn't support such conversion.
Most likely that Zeos uses the same field type for DATE and DATETIME fields.

Posted: Wed 19 Jan 2005 09:48
by Guest
Thank you for your reply Ikar, but isn't it possible to implement it ?

Posted: Thu 20 Jan 2005 15:03
by Ikar
This task is quite difficult. More over it is complicated by possible cases of fields conversion. For example, to implement conversion DATE DATETIME is quite easy, DATE CHAR is more difficult, but DATE BOOL unlikely possible at all.

Please specify a situation for that you need these conversions.

Posted: Thu 27 Jan 2005 13:29
by swierzbicki
For performances issues, I have downgraded some DateTime fields to DateField. (widely used in about 80 tables). With this possibility, I will not have to re-compile my project. It will be a time saving thing for me (but perhaps not for you).

Posted: Thu 27 Jan 2005 15:52
by Ikar
Beside time waste we would like to avoid unnecessary extending the functionality that might cause errors in debugged long ago cases.