VB中怎么怎样创建Access数据库字段的布尔数据类型
VB中如何怎样创建Access数据库字段的布尔数据类型?
我创建一个数据表如下:
Set Cmd.ActiveConnection = Cnn
'设置创建数据表的SQL语句
SQL = "CREATE TABLE " & myTable3 _
& "(序号 text(5) not null primary key," _
& "类别 text(20)," _
& "零件名称 text(20) not null," _
& "数量 text(5) not null," _
& "价格 currency not null," _
& "是否合并 Boolean," _
& "合并区域 text(20))"
'利用Execute方法创建数据表
Cmd.CommandText = SQL
Cmd.Execute , , adCmdText
但运行时布尔数据类型定义出错,不是用Boolean吗?请高手指教!
------最佳解决方案--------------------
SQL = "CREATE TABLE " & myTable3 _
& "(序号 text(5) not null primary key," _
& "类别 text(20)," _
& "零件名称 text(20) not null," _
& "数量 text(5) not null," _
& "价格 currency not null," _
& "是否合并 BIT," _
& "合并区域 text(20))"
------其他解决方案--------------------
几乎所有的数据库对Boolean的控制都不好,简单的char(1),Y/N
我创建一个数据表如下:
Set Cmd.ActiveConnection = Cnn
'设置创建数据表的SQL语句
SQL = "CREATE TABLE " & myTable3 _
& "(序号 text(5) not null primary key," _
& "类别 text(20)," _
& "零件名称 text(20) not null," _
& "数量 text(5) not null," _
& "价格 currency not null," _
& "是否合并 Boolean," _
& "合并区域 text(20))"
'利用Execute方法创建数据表
Cmd.CommandText = SQL
Cmd.Execute , , adCmdText
但运行时布尔数据类型定义出错,不是用Boolean吗?请高手指教!
------最佳解决方案--------------------
SQL = "CREATE TABLE " & myTable3 _
& "(序号 text(5) not null primary key," _
& "类别 text(20)," _
& "零件名称 text(20) not null," _
& "数量 text(5) not null," _
& "价格 currency not null," _
& "是否合并 BIT," _
& "合并区域 text(20))"
------其他解决方案--------------------
几乎所有的数据库对Boolean的控制都不好,简单的char(1),Y/N