首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

VB中怎么怎样创建Access数据库字段的布尔数据类型

2012-12-17 
VB中如何怎样创建Access数据库字段的布尔数据类型?我创建一个数据表如下:Set Cmd.ActiveConnection Cnn

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

热点排行