Error when append record with DefaultExpression value

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Wilton
Posts: 22
Joined: Mon 22 Nov 2004 12:51
Location: São Paulo - Brazil

Error when append record with DefaultExpression value

Post by Wilton » Wed 24 Sep 2008 14:02

Hi,

Since the 5.20.1.15 version that I try to use the updates, without success, I have some types of error and from the 5.50.0.36 version one that I do not have a workaround, when I insert a new record in a table with fields have values in the DefaultExpression property, I receive a error message, because the method BeforeExecute is run with a wrong values
looks like this:

Code: Select all

SELECT AN, N, N
Sorry, but 'AN','N' and 'N' are a DefaultExpression for a 3 differents fields.

Waiting for a answer, I return to version 5.20.1.14, this works fine.

Tks,

patyi
Posts: 14
Joined: Wed 01 Feb 2006 20:55

Nearly same problem on Append

Post by patyi » Thu 25 Sep 2008 18:33

Hi all !

I have the same problem, except my last working version is
5.20.1.15 D7. With newer versions on Append method I get an
error abaut invalid variant conversion.

D7, WinXP

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 29 Sep 2008 09:09

This behaviour was changed in version 5.50.0.34 because of improvement of support of default field values.
In newer versions default values should be quoted, like this:

Code: Select all

  Field.DefaultExpression := '"value"';
To restore old behavior, set the DefaultExpressionOldBehavior variable to True. This varible is declared in the MemDS unit.

Wilton
Posts: 22
Joined: Mon 22 Nov 2004 12:51
Location: São Paulo - Brazil

Post by Wilton » Wed 08 Oct 2008 15:36

Hi, Dimon

Your information solved my problems, I'm using the version 5.50.0.39 and my app works fine.

Tks,

Post Reply