MySQL Forums
Forum List  »  Connector/ODBC

ERROR [23000] [MySQL][ODBC 3.51 Driver][mysqld-5.0.41-community-nt]You have an error in your SQL syntax;
Posted by: Ian McCullough
Date: July 23, 2007 03:18PM

I seem to only have a problem with a certain column in this table....but then again i could be doing something wrong....


ERROR [23000] [MySQL][ODBC 3.51 Driver][mysqld-5.0.41-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc FROM remedy WHERE name='Clearisil 3'' at line 1



is there anything wrong with that syntax?? i have tried
'desc FROM remedy WHERE name='Clearisil 3'' and
'desc FROM remedy WHERE name=Clearisil 3'
both of those do not work

this is my code
Dim queryString As String = "SELECT desc FROM remedy WHERE name='" + RemedyBoxLeft.SelectedItem.Text + "'"
        Dim connectionstring As String = "driver=MySQL ODBC 3.51 Driver;server=192.168.1.76;uid=root;pwd=pwd;database=database"

        Using connection As New OdbcConnection(connectionstring)
            Dim command As New OdbcCommand(queryString, connection)

            connection.Open()

            Dim reader As OdbcDataReader = command.ExecuteReader()

            While reader.Read()
                TextBoxLeft.Text = reader("desc").ToString
            End While

            ' Call Close when done reading.
            reader.Close()
        End Using
the error occurs at

Dim reader As OdbcDataReader = command.ExecuteReader()

anyone know??

Options: ReplyQuote


Subject
Written By
Posted
ERROR [23000] [MySQL][ODBC 3.51 Driver][mysqld-5.0.41-community-nt]You have an error in your SQL syntax;
July 23, 2007 03:18PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.