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.
my $DBFile = 'C:/test/INSTRUCTIONS.mdb'; die "troubles with path of the file" if not -e $DBFile;
maybe there are troubles with passing that argument.. you can use that lines to check if it is like i wrote. – TemperamentData Sources (ODBC)
control panel. Oh, you don't wantqw()
on the filename setup, you probably meantq()
. – Truckageqw()
withq()
– Jameyjami