Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
These are the errors I am getting. The code is as follows:(DBI connect('dbName",'',...) failed: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (SQL-IM002)(DBD: db_login/SQLConnect err=-1) at Filename.plx line 5 Can't call method "prepare" on an undefined value at Filename.plx line + 8.
#Windows-based Perl/DBI/MS Access example use DBI; #open connection to Access database $dbh = DBI->connect('dbi:ODBC:TestCasesXP2K','',''); #prepare and execute SQL statement $sth = $dbh->prepare('SELECT * FROM [TestCasesOutput]'); $sth->execute || die "Could not execute SQL statement ... maybe invalid?"; print "Error 4\n"; #output database results while (@row=$sth->fetchrow_array) { print "@row\n" }
janitored by ybiC: Balanced <code> tags around codeblock, to facilitate code download
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Connecting to MS Access
by keszler (Priest) on Aug 12, 2004 at 16:25 UTC | |
|
Re: Connecting to MS Access
by strat (Canon) on Aug 13, 2004 at 06:26 UTC | |
|
Re: Connecting to MS Access
by inman (Curate) on Aug 12, 2004 at 16:19 UTC |