Default Values

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ACS2000
Posts: 31
Joined: Thu 18 May 2006 11:10

Default Values

Post by ACS2000 » Thu 19 Jul 2012 14:55

Hi

I have come across a problem since upgrading from v5 to v7 of MyDAC.

If you have Default Values set to True in Options and then try to Add/Delete in the Fields Editor it raises an exception. Any attempt to work with the component after this just results in exceptions. You have to exit Delphi (which raises another exception) and restart Delphi. Set Default Values to False and everything works fine.

It never did this in v5. Have I found a bug?

AndreyZ

Re: Default Values

Post by AndreyZ » Fri 20 Jul 2012 09:15

Hello,

The point is that the behaviour of working with default field values was changed in MyDAC version 5.50.0.34. This was done to improve the support of default field values. In newer MyDAC versions default field values should be quoted, like this:

Code: Select all

Field.DefaultExpression := '"value"';
If you want to restore the old behaviour, you should set the DefaultExpressionOldBehavior variable (it is declared in the MemDS unit) to True. For this, you should use the following code in one of the units of your application:

Code: Select all

initialization
  DefaultExpressionOldBehavior := True;

Post Reply