In an application I'm writing, I need to connect to an MS Access database (.mdb) thats on a network drive. I created an ODBC DSN just fine, wrote my chunk of code using DBI and DBD::ODBC, tested it from the command line, and everything seemed to work fine. However, when I try to use this same code from within the mod_perl application, I get:

DBI connect('perl_dbi','',...) failed: [Microsoft][ODBC Microsoft Acce +ss Driver] '(unknown)' is not a valid path. Make sure that the path +name is spelled correctly and that you are connected to the server on + which the file resides. (SQL-HY024)(DBD: db_login/SQLConnect err=-1)

Thinking that Apache was simply unable to handle paths on network drives, I separated the section into a standalone script and tried to shell out to it. However, I still get the same error, which doesn't make any sense at all to me since this script works fine by itself on the command line. I've tried changing the connect line to specify the file to connect to explicitly, but that still doesn't work.

I'm completely lost. Can anyone help?


In reply to Problem with Apache, DBD::ODBC, MS Access, and backticks. by jryan

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.