Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Connection Problem to MS Access Database using DBI

by poj (Abbot)
on May 17, 2019 at 13:25 UTC ( [id://11100170]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Connection Problem to MS Access Database using DBI
in thread Connection Problem to MS Access Database using DBI

This might be a 32 bit / 64 bit problem. I have 64 bit Windows 10 but have 32 bit Office 10. This code works when I tried it on Portable Strawberry 32 bit but not with 64 bit perl.

#!perl use strict; use DBI; my $dbfile = "c:/temp/Database.accdb"; my $dsn = 'driver=Microsoft Access Driver (*.mdb, *.accdb);dbq='.$dbfi +le; my $dbh = DBI->connect("dbi:ODBC:$dsn", '', '') or die $DBI::errstr;; print join "\n",$dbh->tables();
c:\temp>perl -v This is perl 5, version 16, subversion 1 (v5.16.1) built for MSWin32-x +64-multi-thread (with 1 registered patch, see perl -V for more detail) c:\temp>perl c:/temp/access.pl DBI connect('driver=Microsoft Access Driver (*.mdb, *.accdb);dbq=c:/te +mp/Database.accdb','',...) failed: [Microsoft][ODBC Driver Mana ger] Data source name not found and no default driver specified (SQL-I +M002) at c:/temp/access.pl line 6. [Microsoft][ODBC Driver Manager] Data source name not found and no def +ault driver specified (SQL-IM002) at c:/temp/access.pl line 6.
D:\strawberry-perl-no64-5.28.2.1-32bit-portable>perl -v This is perl 5, version 28, subversion 2 (v5.28.2) built for MSWin32-x +86-multi-thread D:\strawberry-perl-no64-5.28.2.1-32bit-portable>perl c:/temp/access.pl `c:/temp/Database.accdb`.`MSysAccessStorage` `c:/temp/Database.accdb`.`MSysACEs` `c:/temp/Database.accdb`.`MSysComplexColumns` `c:/temp/Database.accdb`.`MSysNameMap` `c:/temp/Database.accdb`.`MSysNavPaneGroupCategories` `c:/temp/Database.accdb`.`MSysNavPaneGroups` `c:/temp/Database.accdb`.`MSysNavPaneGroupToObjects` `c:/temp/Database.accdb`.`MSysNavPaneObjectIDs` `c:/temp/Database.accdb`.`MSysObjects` `c:/temp/Database.accdb`.`MSysQueries` `c:/temp/Database.accdb`.`MSysRelationships` `c:/temp/Database.accdb`.`MSysResources` `c:/temp/Database.accdb`.`Table1`
poj

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-24 17:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found