Connect perl to ms access
ms-access-2007, perl
Solution
As indicated in the comments to the question, the Perl script was originally running as a 64-bit process. Therefore the older Microsoft "Jet" ODBC driver
Microsoft Access Driver (*.mdb)
was not available. Only 32-bit processes can use the older Jet driver. If you must run your Perl script as a 64-bit process then you will have to download and install the 64-bit version of the newer Microsoft Access Database Engine (a.k.a. "ACE") from here and then use the driver name
Microsoft Access Driver (*.mdb, *.accdb)
Or, you could run your Perl script as a 32-bit process and use the older Jet driver.
Edit re: comment
Since you have 32-bit Access 2007 installed you already have a 32-bit version of the ACE driver on the machine. That effectively eliminates the option to install the 64-bit version of the ACE driver because the 64-bit ACE installer will abort if it finds 32-bit Office components on the machine. (There is apparently a way to force the second install but it is reported to break Office in some circumstances and is definitely not supported.)
So your options can be revised to:
Run the Perl script as a 32-bit process, or
Remove 32-bit Access 2007 and install a 64-bit version of Access, then run the Perl script as a 64-bit process using the 64-bit ACE driver.
Problem
I am tring to retrive data from a table in access. The code is ``` #!/usr/bin/perl use strict; use warnings; use DBI; my $DBFile = qw(C:test\INSTRUCTIONS.mdb ); my $dbh = DBI->connect("dbi:ODBC:driver=microsoft access driver (*.mdb);dbq=$DBFile",'','') or die("cannot connect to DB"); my $SQLquery = "select * FROM IndemDate"; $dbh->Execute($SQLquery); ``` This is the error i recieve ``` DBI connect('driver=microsoft access driver (*.mdb);dbq=C:test\INSTRUCTIONS.mdb','',...) failed: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (SQL-IM002) at C:/Test/connectaccess.pl line 9. cannot connect to DB at C:/Test/connectaccess.pl line 9. ``` can someone help me rectify my error. Is there any driver I've missed to install.