Exception when changing field type from DateTime to Date

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Guest

Exception when changing field type from DateTime to Date

Post by Guest » Tue 18 Jan 2005 15:10

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

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Re: Exception when changing field type from DateTime to Date

Post by Ikar » Wed 19 Jan 2005 09:45

MyDAC doesn't support such conversion.
Most likely that Zeos uses the same field type for DATE and DATETIME fields.

Guest

Post by Guest » Wed 19 Jan 2005 09:48

Thank you for your reply Ikar, but isn't it possible to implement it ?

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 20 Jan 2005 15:03

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.

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Thu 27 Jan 2005 13:29

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).

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Thu 27 Jan 2005 15:52

Beside time waste we would like to avoid unnecessary extending the functionality that might cause errors in debugged long ago cases.

Post Reply