Hello,

I am a perl pup, but I'm able to make stuff work pretty well. I've delved into attempting to work with a MS Access database, and I'm hitting a brick wall. This is also my first MS PERL experience.

I've seen this error addressed plenty of times, but none of the answers have seemed to offer me any real assistance. Firstly, I can open this db in Access with no problem.

So, with the code below, I get the response listed below it.

#!"c:\documents and settings\user\perl\bin\perl" use DBI; use strict; my $adb = 'testdb.mdb'; my $driver = 'driver=Microsoft Access Driver(*.mdb);dbq='; my $dstring = $driver . $adb; my $dbh = DBI->connect("DBI:ODBC:$dstring","",""); # || die; # "$DBI::errstr"; my @avail = DBI->available_drivers; print "--$_--\n" foreach(@avail); my %drivers = DBI->installed_drivers(); while (my($k,$v)=each(%drivers)) { print "Driver:$k\t-\t$v\n"; } $dbh->disconnect;

Output to screen below

DBI connect('driver=Microsoft Access Driver(*.mdb);dbq=testdb.mdb','', +.. .) failed: [Microsoft][ODBC Driver Manager] Data source name not found + and no de fault driver specified (SQL-IM002)(DBD: db_login/SQLConnect err=-1) at + C:\temp\t emp.pl line 14 --DBM-- --ExampleP-- --File-- --Gofer-- --ODBC-- --Proxy-- --SQLite-- --Sponge-- Driver:ODBC - DBI::dr=HASH(0x1a4d5c4) Can't call method "disconnect" on an undefined value at C:\temp\temp.p +l line 27.
Any help with this is GREATLY appreciated

In reply to MS Access database problem by vdubjunkie

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.