Connect Visual Studio to the database [closed]

1
Hello, I am trying to connect my project in Visual Basic, in Visual Studio, with my MySQL database, it presents the error below, could someone tell me how to solve this problem? I have already installed mysql odbc.

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in Microsoft.VisualBasic.dll

[Microsoft][ODBC Driver Manager] Nome da fonte de dados não encontrado e nenhum driver padrão especificado

In my code I'm importing ADODB. And I am making the connection as follows:

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    ODB = "Provider=MSDASQL.1;Persist Security Info=False;Extended Properties='DSN=fundacao;DESCRIPTION=fundacao;SERVER=localhost;UID=root;password=11111111;DATABASE=fundacao;PORT=3306'"
End Sub

And you're giving this part error:

Sub busca_SQL(SQL)

    cox = New ADODB.Connection
    cox.Open(ODB)
    RX = New ADODB.Recordset
    ' MsgBox(SQL)
    '  Debug.Print SQL
    RX.Open(SQL, cox, , LockTypeEnum.adLockOptimistic, -1) 'aqui coloca-se uma "SQL"

End Sub

Follow print:

My project is a windows application.

    
asked by anonymous 24.08.2016 / 01:48

1 answer

0

I solved the problem by installing the MySQL ODBC 32bit connector along with the 64bit.

    
01.09.2016 / 00:17