ALTER TABLE: Add a new boolean column with default value and checkbox

后端 未结 2 886
天命终不由人
天命终不由人 2021-01-18 18:36

What is the correct Access DDL query to add a Boolean datatype column to a table?

So far I\'ve seen examples like the following...

ALTER TABLE MyTabl         


        
2条回答
  •  粉色の甜心
    2021-01-18 19:03

    In access the Yes/No data type is a logical field that can display yes/no, true/false, or on/off. When you look at VBA code the true and false constants are equivalent to -1 and 0.

    If you use this field to populate a check box it will function properly.

    You may be able to Change your alter statement to use "YESNO" as such:

    ALTER TABLE mytable ADD mynewcolumn YESNO
    

    That should give you the desired check box in the access table column.

提交回复
热议问题