Error updating boolean field

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mydac4std
Posts: 13
Joined: Mon 20 Feb 2006 19:05

Error updating boolean field

Post by mydac4std » Mon 17 Apr 2006 22:29

I am using ver 4.30.0.11 for Delphi 2006.

I have a MySql table with a boolean field, and trying to update this field shows in debug mode the following

UPDATE anlag_aktiver
SET
Lock = :31
WHERE
ID = :Old_1

:31(Boolean,IN)=True
:Old_1(Integer,IN)=3

My Delphi code is just

Table.Edit;
Table.FieldByName('BooleanValue').AsBoolean := True;
Table.Post

I get err #42000 with information saying "...the right syntax to use near 'LOCK=b'1 where ID=3' at line 3"

Any solution?

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Tue 18 Apr 2006 06:13

You try using reserved word 'Lock' as field name. To avoid this problem you should set option QuoteNames to true.

Guest

Ok

Post by Guest » Tue 18 Apr 2006 19:59

Ok, you are right, thanks

Post Reply