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

Hello all

I have to read an MS Access database file from a linux box. What ways are available to do this. Note: I only have the Access file, I do not have access to Access. Which way is the best? Which way is the fastest?

A bit of background...

What needs to be done is to read data from this junk database, and conditionally put the data into MySQL. Of course the first step is to read the Access file...
_______________________________________________
"Intelligence is a tool used achieve goals, however goals are not always chosen wisely..."

Replies are listed 'Best First'.
Re: Reading Access files
by jeroenes (Priest) on Feb 06, 2001 at 19:46 UTC
Re: Reading Access files
by oakley (Scribe) on Feb 06, 2001 at 19:44 UTC
    You might want to read this posting from yesterday... alot of good perl modules pointed out in it - *NOT* saying that the posting itself applies... just some of the modules pointed out =)

    oakley

    Embracing insanity - one twitch at a time >:)
Re: Reading Access files
by dws (Chancellor) on Feb 07, 2001 at 14:22 UTC
    This sounds like a people problem, not a technical problem.

    Did someone actually tell you that you had to read an Access file from a Linux box? Or is it possible that you took an incomplete problem statement at face value, without considering the option of treating it as an openning bid in a negotiation? (One of life's little secrets, that.)

    Assuming nobody comes through with some magic way to read Access files on a non MS platform, your best bet may be to push the problem upstream, and demand flatfiles instead of Access files. Someone, somewhere has access to Access. They must, or you wouldn't be getting Access files. Make the conversion their problem.

Re: Reading Access files
by enoch (Chaplain) on Feb 06, 2001 at 22:27 UTC
    I haven't actually tested what I am about to say, but if I can infer correctly, this should work.
    If you are on a Win32 platform, you can set up an ODBC connection to the Access database by double-clicking on c:\winnt\system32\odbcad32.exe. Make a System DSN that connects to an Access database (namely, the aforementioned Access database).
    Then, you should be able to access it via:
    use OLE; use strict; my ($Conn,$RS) # open connection $Conn->Open("DSN=NameOfODBC;UID=sa;PWD=password;"); $RS = $Conn->execute("select * from table); $RS->Movefirst; while (!RS->EOF) { #... do processing of recordset } $Conn->Close
    Jeremy
Re: Reading Access files
by clemburg (Curate) on Feb 07, 2001 at 14:01 UTC

    In short:

    1. Make the Access file an ODBC source on the Win32 box.
    2. Install Perl, DBI, DBD::ODBC, and DBI::ProxyServer on the Win32 box.
    3. Access the Access File from the Linux box via the DBD::Proxy driver.

    Christian Lemburg
    Brainbench MVP for Perl
    http://www.brainbench.com