Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://117514]
[Discipulus]: ah marto are thou escaping Corion's visit? ;=)

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2017-11-24 08:22 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (346 votes). Check out past polls.