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;
In reply to WIN32:ODBC Perl Connection to Micros~1 Access Database by mr_dont
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |