Ok. I have tried ADO as well with no luck. Please help!
<snip>
# Include CPAN modules for DB communication
use DBI;
#use DBD::ODBC;
use DBD::ADO;
#use Win32::OLE;
# Use these pragmas to code correctly
use strict;
# Include custom functions
require "Functions.pl";
# Debug
$::DEBUG=1;
# Connect to the database, return error message if something went wrong
my ($path_to_mdb_file) = '\\slpmxwtstandclu\testdata$\Data_2.mdb';
my ($dsn)= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=$path_to_mdb_file";
&Debug("About to connect to $dsn");
#$::dbh = DBI->connect( "dbi:ADO::Provider=Microsoft.Jet.OLEDB.4.0;Jet
OLEDB:Engine Type=5;Data Source=$path_to_mdb_file" ,'admin', { AutoCommit => 1}
) or
$::dbh = DBI->connect("dbi:ADO:$dsn", 'Admin', '', { AutoCommit => 1} ) or
&Error("Unable to connect to database.");
<endsnip>
With the first connection string I got:
[Mon Apr 11 14:23:42 2005] [error] [client 151.110.117.153] Usage:
$class->connect([$dsn [,$user [,$passwd [,\\%attr]]]]) at
C:/oracle/ora92/Apache/Apache/ITTWeb/cgi-bin/CLUCTR.pl line 63\r, referer:
http://slpmxwmorenojav/ITTWeb/cgi-bin/Welcome.pl
while with the second I get:
[Mon Apr 11 14:29:57 2005] [error] [client 151.110.117.153] dbih_getcom given
an undefined handle (perhaps returned from a previous call which failed) at
C:/Perl/site/lib/DBI.pm line 598.\r, referer:
http://slpmxwmorenojav/ITTWeb/cgi-bin/Welcome.pl
Regards,
Javier Moreno
-----Original Message-----
From: amonotod [mailto:[EMAIL PROTECTED]
Sent: Friday, April 08, 2005 8:07 PM
To: Moreno, Javier; [email protected]
Subject: Re: Accessing MS Access
> From: "Moreno, Javier" <[EMAIL PROTECTED]>
> Date: 2005/04/08 Fri PM 03:44:40 CDT
<snip>
> I posted a question and have tried several solutions on how to open
> up an MS Access DB from the DBI::ODBC but so far have been unable to.
<snip>
> I was wondering if there is a better way to get information
> from Access so I can see it on my CGI with DBI.
<snip>
Well, I've posted several times (the last time was in a reply to a
thread that you started) that you should use ADO to connect to your
Access database, and I gave you connection examples. So, I guess the
answer is yes, there may indeed be a better way to connect to your
Access database than with DBD::ODBC. If not better, at least different.
http://www.nntp.perl.org/group/perl.dbi.users/26145
> Regards,
> Javier Moreno
HTH,
amonotod
--
`\|||/ amonotod@ | sun|perl|windows
(@@) charter.net | sysadmin|dba
ooO_(_)_Ooo____________________________________
_____|_____|_____|_____|_____|_____|_____|_____|