(1) bit
(2) 用0和1 例如 update xxx set ifa = 1 where ...

解决方案 »

  1.   

    (1)假如建立一个表的结构以下:
    id   shifou
    ------------
    (其中shifou字段类型为bit)(2)建立一个过程:
    Public Sub add(bolshifou As boolean)      (如果这里bolshifou是integer就一定不会错)
        Dim cnn As New ADODB.Connection
        cnn.Open " "    sql = "insert into testbool(shifou) values(" & bolshifou & ")"
        cnn.Execute sqlEnd Sub(3)主程序调用:
        Dim bolshifou As boolean
        bolshifou = 1        
        test.add (bolshifou)
     
    但是结果出错,因为最后SQL语句是insert into testbool(shifou) values(true),而true不能放进bit字段。
    到底怎么解决呢?特别在变量定义方面。
      

  2.   

    将sql中的 bolshifou 写成iif(bolshifou,"1","0")
      

  3.   

    transaction sql:declare ifa bit
    set ifa=1
      

  4.   

    sql server 中没有布尔类型