Forum Moderators: coopster & phranque

Message Too Old, No Replies

Perl and MS Access

         

circuitjump

3:11 pm on Sep 26, 2001 (gmt 0)

10+ Year Member



I'm trying to connect a perl script to an access DB

This is the code for the connection

open(INF,"$/mainstreet/Htdocs/data/data.mdb") ¦¦ dienice("Can't open data.mdb: $! \n");

I don't think I'm doing the right thing here, so may I get a little bit of help, please :)

Thanks

gethan

5:02 pm on Sep 26, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't know if there is an easier way than this but heres what I did... (ages ago)

1) Register the access db as an OBDC database
2) Use the ODBC module

Heres a snippit.

use Win32::ODBC;
$dbh = DbConnect("DBNAME");

circuitjump

5:35 pm on Sep 26, 2001 (gmt 0)

10+ Year Member



Thanks gethan

I'll try it out

littleman

6:21 pm on Sep 26, 2001 (gmt 0)



You could also use DBD::ODBC [dbi.symbolstone.org] which would make porting the script easier if you ever decide to use a different database backend.