Run Time error -2147467259 (80004005) |
Sometimes, when we are trying to connect MySQL/MariaDB database, it returns an error “[Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified”
In my case, When I’m using Visual Basic 6 and I never change the line of codes for the connection module, suddenly it returns an error like the above. I’m trying to find the error through the error message.
Then, after I googled the solution, I found that I must add New Data Source on ODBC. So, I open the ODBC and add New Data Source on the System DSN tab, but it still returned an error.
Another thought is MySQL Connector driver installed is for 32-bit, but when I checked the version it’s for 64-bit.
Again, adding a parameter on the connection string: Persist Security Info=true, inspired by my old case about the SQL Server connection string, and still not solved.
Finally, IT SOLVED by changing MySQL ODBC Driver from MySQL 8.0 Unicode Driver to MySQL ODBC 5.1 Driver.
MySQL ODBC 5.1 Driver |
My Conclusion is that the MySQL ODBC 8.0 Unicode Driver has bugs, that cause when Visual Basic try to connect through the driver, the MSADO library doesn’t recognize the driver and returns an error “[Microsoft] [ODBC Driver Manager] Data source name not found and no default driver specified”
With the same error pattern, maybe you can change the MySQL driver as I did, and you can also downgrade the driver version. I'm using version 5.01.6 (mysql-connector-odbc-5.1.6-winx64) that works to my case.
No comments:
Post a Comment