Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have a MS access database 'data.mdb' on a linux (Redhat 6.2) filesystem, I want to read this file and display some output with a perl program (running on the linux machine). I manually converted the 'data.mdb' to 'data.csv' (with MS access) and using DBI::CSV was able to read and display the data. Now, I want to read the data directly from the data.mdb, but I'm confused as to what DBD is necessary? I'm not using any DB server or $DSN, I just want to read (not change) the data.mdb file from the linux filesystem and output data from my perl program running on the linux box. Can this be done without the manual convert to csv?
  • Comment on Linux filesystem reading a MS Access database

Replies are listed 'Best First'.
Re: Linux filesystem reading a MS Access database
by asiufy (Monk) on May 23, 2001 at 06:38 UTC
    I believe that can't be done (at least not without the specifications of Microsoft's *.mdb file format), as you'll need the actual application to serve the database data.

    Perhaps you could set up a PC with Access and ODBC. Or even write a batch/macro on the PC that exports the *.mdb to *.csv daily, and posts it to the Linux box.
Re: Linux filesystem reading a MS Access database
by mpolo (Chaplain) on May 23, 2001 at 10:44 UTC
    I don't know of a way to directly read an Access file, but have had some success with converting them to MySQL, which should provide a bit more power than using CSV.

    There are programs out there to convert Access DB's to MySQL format, but looking for them, I found something that may be even more interesting for you. According to this page, you can accomplish this with ODBC directly. However, they seem to be talking about a Virtual server on the Windows machine -- you'd need to tweak and use ODBC on both machines, I imagine.

    One converter mentioned on the MySQL page is MyAccess. This will allow an Access Export to MySQL and Access queries to a MySQL DB. Finally, at Cynergi, there is an Access VB script to generate a MySQL input. Here you have the source, so you might be able to hack together something more to your liking.... (This last is the way I actually converted my Access DB.)