in reply to DBD::ODBC connection prob

You should just be able to use

my $DSN = 'driver=Microsoft Access Driver(*.mdb);dbq=C:/dyc/dyc.mdb';

I had some problems with that when trying to use Win32::ODBC with a Access database. What I ended up doing was writing a file DSN on the fly, then cleaning it up on exit. That seemed to work a little better for me. It was something like this:

# Create the MS Access DSN my $dsncontents = <<"EODSN"; [ODBC] DRIVER=Microsoft Access Driver (*.mdb) UID=admin UserCommitSync=Yes Threads=3 SafeTransactions=0 PageTimeout=5 MaxScanRows=8 MaxBufferSize=2048 FIL=MS Access DriverId=25 DefaultDir=$datadir DBQ=$file EODSN open(DSN, ">$datadir/Report.dsn") or die "Couldn't create new DSN!\n"; print DSN $dsncontents; close(DSN); $accessdsn = "FILEDSN=$datadir/Report.dsn";

Where I had previously defined the access file name ($file ), data directory ($datadir ) and then used $accessdsn as the parameter for the call. All I did was create a working file DSN for the database, then copy the contents into my application, changing certain elements to variables. In your case, if the datadir and file name are constant, you could probably just have all the values hardcoded or just put a file DSN in with the Access database.


«Rich36»