Connecting to MYSQL server with VBA (cannot use ODBC)

jinx_uk_98

Board Regular
Joined
Jul 3, 2005
Messages
105
Hi there,

I want to create a database that connects to a MYSQL database to run some reports. Normally I would do this trough Get External data and use a ODBC connection.

The problem is this database is going to be saved to a shared folder where anyone can open and run the access reports at anytime. The users won't necessary have ODBC drivers installed.

Is there anyway I can code the connection settings and refresh tables instruction in VBA? or maybe there is a better solution entirely.

Basically my user need to run up to date reports from a MYSQL database, ideally using access as the report with have a field that converts some text to a barcode


Many thanks
Kev
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi there,

I want to create a database that connects to a MYSQL database to run some reports. Normally I would do this trough Get External data and use a ODBC connection.

The problem is this database is going to be saved to a shared folder where anyone can open and run the access reports at anytime. The users won't necessary have ODBC drivers installed.

Is there anyway I can code the connection settings and refresh tables instruction in VBA? or maybe there is a better solution entirely.

Basically my user need to run up to date reports from a MYSQL database, ideally using access as the report with have a field that converts some text to a barcode


Many thanks
Kev

Kev,

Unfortunately what you want to do is probably not possible for several reason.

1) You should not share a database. Every user will need their own copy.

2) Every workstation that will open the database will need the ODBC drivers installed.


The mySQL ODBC drivers are what allow any software, including Access to talk to an ODBC compliant database.

Access will require the ODBC drivers to be installed. You can use a DNS-less connection so you do not have to set up an an ODBC connection in the Control Panel.

You may need to create a .NET web App.

@Dennis, you liked to the Connector/Net which is a fully-managed ADO.NET driver for MySQL. Unfortunately, Access can not use the .NET libraries. Access can use the standard ODBC Drivers.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,545
Messages
6,125,448
Members
449,227
Latest member
Gina V

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top