Subject Re: [firebird-support] boolean fields
Author Milan Babuskov
Peter Sanders wrote:
>>We have converted our Booleans to T or F char fields. This works great
>>with
>>all the standard Delphi components we use, even our .AsBoolean code works
>>perfectly. You should be able to do your 'if Data.Field then' code, I am
>>not sure because we prefer explicitly doing the comparison 'if
>>DataField.AsBoolean = True then'.
>
> Thanks for the info. I will wander off now and try that with my db and see
> if it works for me. BTW I did try a DOMAIN definition with a 0-1 check
> contstraint and it did work, however I think your implementation is better.

Why not use both? Have a check contstraint in database to make sure you
don't enter invalid values, and handle .AsBoolean stuff from
application. You can have check for 'T' and 'F' same as you can for 0-1.

--
Milan Babuskov
http://fbexport.sourceforge.net
http://www.flamerobin.org