这是代码
Public Sub DeleteRoom(Room_ID As String)
Dim CNo As Object
Set CNo = SQLDNSCONNECT("TEST")
Dim RSo As Recordset
Set RSo = New Recordset
Dim msql As String
With CNo
.Open
If RSo.State = adStateOpen Then RSo.Close
msql = "DELETE * FROM Room WHERE Room_ID='" & Room_ID & "'"
RSo.Open msql, CNo
MsgBox "Record(s) Deleted", vbInformation, ""
End With
End Sub
错误是“RSo.State = adStateOpen Then RSo.close”
我不知道为什么,但它看起来确实如此。
有人可以帮助我吗?
答案 0 :(得分:2)
DELETE
子句不接受列:
只需删除*
:
DELETE FROM Room WHERE Room_ID=...