mr_dont has asked for the wisdom of the Perl Monks concerning the following question:
Dear Fellow Monks,
I am stumped regarding an issue with the WIN32:ODBC module and a Micros~1 Access Database.
Comming from a completely Un*x-y background, I have found a need to use the WIN32:ODBC driver to connect to a Windows Access database via Perl CGI. I have done this before with an already existing Access database. But now I need to use a DNS-less connection, as well as an Access database I made myself. I created a database using Access and uploaded it to my server. I then used the code below to connect to the database. I didn't get a connection error. However, when I tried to call any methods on my "$db" object, I get errors. What do I have to do to successfully connect? Do I have to save my Access database in some special way? Does any Monk know where I can go to read more about this, I can't find a good reference anywhere!
My code looks like this:Thanks Monks!# Load necessary modules use Win32::ODBC; use CGI; use CGI::Carp qw(fatalsToBrowser); # DNS related Variables... $username = "foo"; $password = "bar"; $database_path = "name_of_my_database.mdb"; #create database object called $db... $db = new Win32::ODBC("DNS=$database_path;UID=$username;PWD=$password" +); # These lines do not give me an error... # Doesn't this mean I have a proper connection? if (undef $db){ Win32::ODBC::DumpError(); } # This line gives me an error which says something # like Can't call method "Connection" on undefined # value... $con_number = $db->Connection;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: WIN32:ODBC Perl Connection to Micros~1 Access Database
by simon.proctor (Vicar) on Jan 05, 2002 at 06:33 UTC | |
|
Re: WIN32:ODBC Perl Connection to Micros~1 Access Database
by chromatic (Archbishop) on Jan 14, 2002 at 03:55 UTC | |
|
Re: WIN32:ODBC Perl Connection to Micros~1 Access Database
by cheshirecat (Sexton) on Jan 05, 2002 at 05:36 UTC | |
by Anonymous Monk on Jan 05, 2002 at 06:47 UTC | |
by mr_dont (Beadle) on Jan 05, 2002 at 06:49 UTC | |
by cheshirecat (Sexton) on Jan 06, 2002 at 01:06 UTC |