(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字段。 到底怎么解决呢?特别在变量定义方面。
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字段。
到底怎么解决呢?特别在变量定义方面。
set ifa=1