简单的SQL遇见问题,请给看看
Private Sub CommandButton1_Click()
Dim name As String, id As String
Call linkaccess
name = TextBox1.Text
id = TextBox2.Text
rs.Open "insert into 表1 (姓名 ,员工编号) values (name,id)", cn
End Sub
VBA中运行提示SQL语句错误,大家看看?
[最优解释]
cn.execute "insert into 表1(姓名,员工编号) values('"& name &"','"& id &"')"
[其他解释]
"insert into 表1 (姓名 ,员工编号) values ('" & name & "' ," & id
反正就是把value引进去
[其他解释]
insert into 表1 (姓名 ,员工编号) values ('" & name & "'," & id & ")
[其他解释]
谢谢大家哦
[其他解释]
加上单引号撒!!~