Hi,
I have a boolean field declared like this :
active_client tinyint(1) UNSIGNED DEFAULT '255'
When trying to fill a TMyTable I do
DestTable.FieldByName(FieldName).value := FieldValue;
here FieldValue is 0 or 255, but I get 0 or 1 when looking at the table.
Any idea ?
Regards
Problem with TMyTable and boolean field
Re: Problem with TMyTable and boolean field
By default, tinyint(1) MySQL server field is mapped to a TBooleanField. This field works with boolean values, and therefore all values are converted to 0 and 1. To work with integer values, set the TMyTable.Options.EnableBoolean property to False. At this, the field will be mapped to TSmallintField.
More details about the TMyTable.Options.EnableBoolean property can be seen in the MyDAC documentation:
http://www.devart.com/mydac/docs/index. ... oolean.htm
More details about the TMyTable.Options.EnableBoolean property can be seen in the MyDAC documentation:
http://www.devart.com/mydac/docs/index. ... oolean.htm