Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Perl and MS Access

by mr_dont (Beadle)
on Oct 08, 2001 at 21:17 UTC ( #117514=note: print w/ replies, xml ) Need Help??


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.


Comment on Re: Perl and MS Access
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://117514]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2014-10-24 15:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (132 votes), past polls