VB中插入ACCESS数据库的问题

来源:百度知道 编辑:UC知道 时间:2024/05/13 07:52:03
Dim abc As String
abc = "insert into Delivery(Products,Qty,Price,Descrip,Supplier,ImDate,UserID) values (" & Trim(Combo1.Text) & "," & Trim(Text8.Text) & "," & Trim(Text6.Text) & "," & Trim(Text9.Text) & "," & Trim(Combo3.Text) & "," & Trim(MaskEdBox1.Text) & "," & Trim(Combo2.Text) & ")"
conn.Execute(abc) '执行插入操作

不知道为什么插不进去

Dim abc As String
abc = "insert into Delivery(Products,Qty,Price,Descrip,Supplier,ImDate,UserID) values ('" & Trim(Combo1.Text) & "','" & Trim(Text8.Text) & "','" & Trim(Text6.Text) & "','" & Trim(Text9.Text) & "','" & Trim(Combo3.Text) & "','" & Trim(MaskEdBox1.Text) & "','" & Trim(Combo2.Text) & "')"

试试吧, 少单引号了.