Error opening Mysql connection via ADODB

Asked

Viewed 814 times

2

I’m trying to connect an application made in VB, Visual Studio 2017, using ADODB as a connection, but it is with several errors for different connection options. Already anticipating me, I checked the drivers of the ODBC data sources and there is the 64 bit Mysql Driver ("Mysql ODBC 5.3 ANSI Driver" and "Mysql ODBC 5.3 Unicode Driver")

ATTEMPT 1:

Dim conn As New ADODB.Connection
Dim aux As String
aux = "Driver={MySQL ODBC 5.3 ANSI Driver}; server=localhost,3306; Database=db-teste; uid=root; pwd=123456; Option=3;"
conn.Open(aux)

ERROR FOUND: Data source name not found and no default driver specified'

ATTEMPT 2: After creating a new ODBC data source of "User" ("DSN User" guide of the data sources) with name "Connection_db-TEST" and another source System ODBC data (in the "DSN System" tab) with name "Connection_db-TESTE2" and test both as follows, presented a different error from the previous one:

Dim conn As New ADODB.Connection
conn.Open("Conexao_DB-TESTE")

ERROR: The specified DSN contains an architecture incompatibility between the Driver and the Application

I don’t know what’s wrong and I haven’t found other options. How do I establish the connection to Mysql via ADODB?

1 answer

2

I already took care of it. I downloaded the previous version of the Mysql driver, Connector/ODBC 5.2.7, for 32-bit and recreated the DSN in "ODBC (32-bit) data sources" in the Windows 10 Administrative Tools. Driver link

Browser other questions tagged

You are not signed in. Login or sign up in order to post.