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

In reply to Re^3: Connection Problem to MS Access Database using DBI by poj
in thread Connection Problem to MS Access Database using DBI by merrymonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.