Quote:
Originally posted by swiatlo
I have finished application (Borland Builder C++) useing BDE and Paradox table. After all I wanted to change engine to other. It is MySQL + ODBC. Now there is no more suport for SQL statements like:
"select * from TableName"
"where record_saved = true"
record_saved is ftBoolean type. MySQL returns error:
>> true - invalid column name<<.
ftBoolean is converted to TINYINT(1).
How can I overcome this, and make my app to work with no big changes. Is there an interface I can modyfy 'false -> 0' 'true -> 1' ?
|
Use the ORD function (Delphi has it, I presume that C Builder also has it). It returns the ordinal value of a boolean being either 1 for TRUE or 0 for FALSE.
"select * from TableName"
"where record_saved = " + IntToStr(Ord(true))
Hope this helps.
Niels