in reply to Perl and MS Access
I once wrote a perl script that connected to an Access Database using the Win32::ODBC module...
Here is a bit of code to get you started:
# Load the module use Win32::ODBC; # Make a new database object, the dsn, # userid, and password are things you need # to fill in my($db) = new Win32::ODBC("dsn=yourdsn; uid=foo; pwd=bar"); # Send the database some SQL $db->Sql("SELECT * FROM your_table"); #print out some stuff while ($db->FetchRow()) { my(%data) = $db->DataHash(); print "Your data is: $data{'some_value'}"; } # Close the database $db->Close();
It is a good idea to include statements that check for errors... maybe you should read this tutorial.
|
---|
In Section
Seekers of Perl Wisdom