Insert error

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
olegP
Posts: 6
Joined: Wed 06 Jul 2011 19:32

Insert error

Post by olegP » Thu 07 Jul 2011 10:42

Component MSQuery Options.DefaultValue=False. Some fields have DefaultExpression=aaaaa
WITHOUT quotes!!

When I try to add record I get error
The multi-part identifier "aaaaa" could not be bound.
In Profiler I see
SELECT aaaaa , aaaaa
If I set DefaultExpression='aaaaa' (with quotes) It's OK.

AndreyZ

Post by AndreyZ » Thu 07 Jul 2011 13:56

Hello,

Such behaviour is correct. SDAC allows using server functions in the DefaultExpression property. That's why you should quote the string value in the DefaultExpression property.

olegP
Posts: 6
Joined: Wed 06 Jul 2011 19:32

Post by olegP » Thu 07 Jul 2011 14:19

Thanks. It's OK.

Post Reply