ODBC 5.1驱动程序[mysqld-5.1.41]语法错误

时间:2012-01-04 15:19:34

标签: mysql vb6 odbc

这是代码

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”

我不知道为什么,但它看起来确实如此。

有人可以帮助我吗?

1 个答案:

答案 0 :(得分:2)

DELETE子句不接受列:

只需删除*

即可
DELETE FROM Room WHERE Room_ID=...