Thank you.
Having searched my system I believe I did connect to an Access database in 2008 (clearly using an earlier version of Access compared to Access 2010 I now am using)
The dsn definition was
$dsn = "DBI:ODBC:PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.m +db)};DBQ=" . $db_name;
or
$dsn = "DBI:ADO:PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.md +b)};DBQ=" . $db_name;

The connect Perl row was
DBI->connect($dsn, "", "") or ($dbh_ok = 'no');

I did try one of the dsn defintions suggest (it is below) there are some small differences however I got exaclty the same error messages.
$dsn = 'dbi:ODBC:Driver={Microsoft Access Driver (*.mdb, )};DBQ=' . $d +b_name;
I am not sure which worked but I think one of them did since the Perl writes the meta data for the database and there is a file of this as well.
When I use the code now I get the following error messages for the ODBC version - I could not use the ADO since ADO was no longer there.

DBI connect('PROVIDER=MSDASQL;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=FULL PATH TO Access Databse\StockH.mdb','',...) failed: MicrosoftODBC Driver Manager Data source name not found and no default driver specified (SQL-IM002)

Therefore it looks like Access 2010 needs something different to what was successful for a previous version of Access.

Can anyone tell me what I should be using for this?

In reply to Re^2: Connection Problem to MS Access Database using DBI by merrymonk
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.