Using Visual Basic for Applications, how can I find out which version of the MySQL ODBC driver is installed in Windows on a user’s machine?
I have a Microsoft Access application that uses the MySQL ODBC driver to make a connection. The connection string looks like this:
ODBC;DATABASE=mydatabase;DRIVER={MySQL ODBC 3.51 Driver};
OPTION=3;PWD=password;PORT=3306;SERVER=server-db;UID=db-user;
This was working find until the IT manager installed version 5.1 of the MySQL ODBC driver on a user’s PC, which broke my connection string.
If I knew the version of the driver installed on the user’s Windows XP installation, I could insert that into the connection string at run-time. How can I find out which version of the MySQL ODBC driver is installed in Windows on a user’s machine using VBA?
You can find it in the registry under
Using the info found here, you can get at it using the below code (I tested it in Access 97)