What are the numbers corresponding to the access type?

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.