The customer's database was manually upgraded recently, and there was a problem. The upgrade code is:
With adoquery1 do
Begin
Close;
SQL. clear;
SQL. add ('Update xtsz set column1 =: v0'); // The column type is bit
Parameters [0]. value: = false;
ExecSQL;
End;
Execute the SQL statement in the access query. If the value of v0 is false or true, it must be 0 or not. Is 0 false or is it false if it is not 0? Open the existing records in the xtsz table. One of the column2 fields is also of the bit type. The following check box is used to indicate true. Then let's test it:
Select iif (column2 = 0, 'false', 'true') from xtsz
The execution result is true, which indicates that the result is correct. If the value is 0, the result is false. If the value is not 0, the result is true.
Is there another doubt that the accuracy is not 0? Any number is required? Try again:
Select iif (column2 = 1, 'true', 'false') from xtsz // a record in column2 is not checked, indicating false
After execution, the return value is false, indicating that 1 is not false. Change the value to another one:
Select iif (column2 =-1, 'true', 'false') from xtsz
The returned result is true after execution, which is correct. If false is returned for testing other numbers, it indicates that false only corresponds to one number, that is,-1.
The result is displayed. in access, yes/no, that is, the bit type corresponds to false = 0, true =-1.