Private Sub Command2_Click()
Set rs = New adodb.Recordset SQL = "select * from biao2 where kehu2='" & Text1.Text & "'"
Set rs = db.Execute(SQL) If Not rs.EOF Then
MsgBox "已经存在该用客户"
Else
rs.AddNew
rs("Kehu2") = Text1
rs("suoxie2") = Text2
rs.Update
MsgBox "客户添加成功"
End IfEnd Sub
提示
对象或提供者不能执行所需操作怎么弄啦,我看着好像没错啊
XIEXIE
Set rs = New adodb.Recordset SQL = "select * from biao2 where kehu2='" & Text1.Text & "'"
Set rs = db.Execute(SQL) If Not rs.EOF Then
MsgBox "已经存在该用客户"
Else
rs.AddNew
rs("Kehu2") = Text1
rs("suoxie2") = Text2
rs.Update
MsgBox "客户添加成功"
End IfEnd Sub
提示
对象或提供者不能执行所需操作怎么弄啦,我看着好像没错啊
XIEXIE
加2个空格试试
SQL = "select * from biao2 where kehu2 = '" & Text1.Text & "'"
Set rs = db.Execute(SQL)
改为: SQL = "select * from biao2 where kehu2 = '" & Text1.Text & "'"
rs.Open SQL, db, adOpenStatic, adLockOptimistic