user1130195
user1130195

Reputation: 11

ODBC 5.1 Driver [mysqld-5.1.41] Syntax Error

here's the code

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

The error is the "RSo.State = adStateOpen Then RSo.close"

I don't know why but it really seems right.

Can someone help me?

Upvotes: 0

Views: 544

Answers (1)

Álvaro González
Álvaro González

Reputation: 146350

The DELETE clause does not accept columns:

Just remove the *:

DELETE FROM Room WHERE Room_ID=...

Upvotes: 2

Related Questions