daok Posted December 28, 2003 Posted December 28, 2003 Dim strConnection As String strConnection = "driver={MySQL};server=localhost;uid=usgNormal;pwd=;database=myDatabase" ';OPTION=17923" Dim myConnection As New OdbcConnection(strConnection) Dim sqlSelectCommand As New OdbcCommand() sqlSelectCommand.CommandText = "Select * from correction" sqlSelectCommand.Connection = myConnection Try sqlSelectCommand.Connection.Open() Dim mySR As OdbcDataReader = sqlSelectCommand.ExecuteReader Dim cnt As Integer = 0 While mySR.Read cnt += 1 txtIP.Text = mySR("ip") txtTime = mySR("date") txtMsg.Text = mySR("msg") End While myConnection.Close() Catch e As Microsoft.Data.Odbc.OdbcException MsgBox(e.ToString) End Try End Sub Why do I got a message box with this text : Microsoft.Data.Odbc.OdbcException: ERROR [iM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified at Microsoft.Data.Odbc.OdbcConnection.Open() at WindowsApplication10.frmTestingSql.LoadingDate() in C:\Documents and Settings\Francois\Mes documents\Visual Studio Projects\WindowsApplication10\Form1.vb:line 102 Quote
daok Posted December 28, 2003 Author Posted December 28, 2003 Forget about it the problem was that I had forgotten to add the word "ODBC 3.51 Driver" after mySql Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.