In this post I am going to show you how to connect to your MySQL web database from your Access desktop database.
Here are the steps:
1. MySQL table
2. Access MySQL ODBC connector
3. Link table from Access
4. Create search form. (in part 2 of this post)
I am going to use the “MySQL ODBC 5.2 Unicode Driver” because I know it works.
Download it here: https://dev.mysql.com/downloads/connector/odbc/5.2.html
After you click the link, you will probably have to “Login Now or Sign Up for a free account” with MySQL/Oracle, but they don’t seem like
they send you a lot of junk email.
The ODBC driver is worth it, because it allows an ODBC connection for MySQL.
Choose the 32 bit version of the driver, because most of the time you are going to be dealing with a basic 32 bit installation of Access.
Here’s what it looks like on their webpage:
This is generally what they install at most companies, because they don’t need all the “bells and whistles” of 64 bit installations.
Most basic Access installations are 32 bit.
If you are at home, and have some super, duper fancy gaming computer setup, you may have chosen 64 bit, but it’s not likely.
After you’ve installed the driver, you can set up your connection.
Add your ODBC
[Create a new data source]
Before we get connection errors we need to permit remote connections on our web database.
Since I am using hostmonster.com as my webhost, I need to make sure my IP address is allowed for remote access of the MySQL database.
From the “Control Panel” tab, click on “Remote Mysql Database Access”:
First you need to get your external IP address. Use https://www.whatismyip.com/ to find this out.
Also make sure you add a user and password to access your MySQL database:
Now you should be able to complete your ODBC connection:
The “Connection Successful” message, is a good sign. It means you have completed the “hard part”, and it’s working correctly! So pat yourself on the back 🙂
Now we can connect to the MySQL database from Access
This is the “easy” part, so just follow the following images:
This is a “Machine Data Source”:
That’s all. Let me know if you need help.