export tables from mysql -> ms access

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
hi there,

i've got a mysql database with a research data. i would like to get
some information from that database and save it as ms access database.

it will be a client feature. the client clicks a button -> and
downloads ms access database with a certain information from the master
mysql database.

is it possible in php? how?

thanks a lot,

Re: export tables from mysql -> ms access

Richard wrote:
Quoted text here. Click to load it

I would say to do this you're going to need to create an ActiveX control  
(you are running on Windows hosting, aren't you?) to create the database  
and registers it as an ODBC source.  Than you can use the ODBC functions  
to add your data (or just put that in the ActiveX control while you're  
at it, also).

If you're not running on Windows hosting, you're out of luck.

Alternative, just save it in CSV format and let them do whatever they  
want with it.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: export tables from mysql -> ms access

Richard wrote:

Quoted text here. Click to load it

This would not be easy. MS Access (MDB) files are a proprietary binary
format. Assuming a Linux/UNIX server, there is virtually no software able
to manipulate them. MDB Tools <http://mdbtools.sf.net/ provides a Linux
ODBC driver for MDB databases, but this is read only, so while you can
use this ODBC driver to extract information from Access and insert it into
another database, you can't use it the other way around. They are working
on a read-write driver, but don't expect it any time soon (at least not in
a stable form!).

If you're running PHP on a Windows platform, with the Access DLLs
installed, you might have slightly better luck. The basic technique would
be, in advance, to create a blank database with all the right tables,
views, forms and so forth set up, but not populated with any data. Then,
when required, in PHP you could do a simple file copy of that database,
connect to it through ODBC, populate it with data, using INSERT queries,
then allow it to be downloaded.

Do the client really need it in Access format? Would it be a better idea
to provide them with a read-only phpMyAdmin-type solution, which they
could use to query?

Another idea, if you have control of the server's firewall, would be to
allow the client to connect directly to MySQL on TCP port 3306. You will
need to be very careful with security here. But this will allow them to
hook Access up to your live data, perform queries and run reports on it.
(You can create a special read-only user in MySQL for such purposes.)

Toby A Inkster BSc (Hons) ARCS
Contact Me  ~ http://tobyinkster.co.uk/contact

Re: export tables from mysql -> ms access

Quoted text here. Click to load it

Not really. But if it is always the same data, and if you do not mind  
others to connect with one of your databases, there's an other approach:

You could make the exported tables accessible for others using normal  
user management and imports these links through ODBC from MS-Access.

You can control what data is visible and what is not by giving access to  
views, separate tables or even a separate database.

Those links can be either links or imports, so once a table is linked  
from MS-Access, it can remain up-to date. The downside of this approach  
is that you need MyODBC (can be downloaded from the MySQL site) on every  
client that wants to link to your database.

Best regards

Re: export tables from mysql -> ms access

Richard wrote:
Quoted text here. Click to load it
Take a look at Navicat.com.  The program is a MySQL front-end  
application that has an 'Export Wizard' that features a conversion to MS  


Site Timeline