Wrox Home  
Search P2P Archive for: Go

  Return to Index  

ado_dotnet thread: MySQL


Message #1 by Jay Fields <JFields@c...> on Mon, 30 Sep 2002 15:22:05 -0400
Has anyone had success connecting to MySQL?  I have MySQL installed and I
haven't configured anything (because I don't know what to change).  I
downloaded the ODBC data adapter, but I can't get a valid connection.
My Code:
---------
    <WebMethod()> Public Function dbConnect() As String
        Dim connString As String = "DRIVER={MySQL ODBC 3.51 Driver};" & _
                        "SERVER=localhost;" & _
                        "DATABASE=test;" & _
                        "UID=test;" & _
                        "PASSWORD=test;" & _
                        "OPTION=3"
        Dim MyConnection As New OdbcConnection(connString)
        Try
            MyConnection.Open()
            MyConnection.Close()
            Return connString
        Catch e As Exception
            Return e.Message
        End Try
    End Function
----------------------
It's returning the following exception: ERROR [IM002] [Microsoft][ODBC
Driver Manager] Data source name not found and no default driver specified

  Return to Index