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

I need to write a script that queries a MS Access database (in a .mdb file). The file itself is sitting on the Linux box which this script will be running from. The program that uses the DB runs on a Windows box and accesses the .mdb file via a samba share.

What are my options for accessing this DB from the Linux side? Can I read from the .mdb file directly with some module? Can I use DBD::ODBC to access the DB across the network?
  • Comment on getting data from a Microsoft Access DB (.mdb file)

Replies are listed 'Best First'.
Re: getting data from a Microsoft Access DB (.mdb file)
by dragonchild (Archbishop) on Jan 04, 2005 at 20:43 UTC
    The first place to start is That has the tools needed to access the Jet database engine, which is the underpinning of MS Access, MS Money, and a few others.

    The next step is to use DBD::ODBC and the ODBC driver that comes with MDBTools to access it. At this point, you're beyond my knowledge.

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

      You've been extremely helpful. I'm compiling mdbtools now and then I'll read through the docs. Thanks.
Re: getting data from a Microsoft Access DB (.mdb file)
by Grygonos (Chaplain) on Jan 04, 2005 at 20:41 UTC

    DBD::ODBC has worked for me in the past. That's from a windows box, but I don't think the module is platform specific, however you will need a driver. Some links to potential drivers for linux are provided in the documentation in the link above.

      The ODBC driver, in this case, needs only to work on the machine where the script will run. DBD::ODBC will work perfectly for this.

      I somehow missed "From the Linux side" in the root node, making the redacted text entirely redundant. My bad.

      Anima Legato
      .oO all things connect through the motion of the mind