Hi,

I have to access an old Sage MAS 90 database, I can connect fine with an ODBC query tool using the connection string "Driver={MAS 90 4.0 ODBC Driver};Directory=S:\v440\MAS90"

But when I try with Perl I get:

use strict; use warnings; use DBI; my $dbuser = "user"; my $dbpassword = "password"; # SOTAMAS90 my $CONNECT = 'Driver={MAS 90 4.0 ODBC Driver};Directory=S:\v440\MAS90 +'; my $dbh = DBI->connect("dbi:ODBC:$CONNECT", "$dbuser", "$dbpassword") or die "Cannot connect to $CONNECT: $DBI::errstr\n"; $dbh->disconnect
It fails with:
C:\>test_1.pl DBI connect('Driver={MAS 90 4.0 ODBC Driver}','user',...) failed: [Mic +rosoft][ODBC Driver Manager] Data source name not found and no defaul +t driver specified (SQL-IM002) at C:\test_1.pl line 11. Cannot connect to Driver={MAS 90 4.0 ODBC Driver}: [Microsoft][ODBC Dr +iver Manager] Data source name not found and no default driver specif +ied (SQL-IM002)
The driver is a 32bit on (if that's relevant)

I've also tried using its user DSN name SOTAMAS90 instead but that fails as well.

I've never used ODBC before and am not used to working on Windows so any help to helping me connect would be great!


In reply to ODBC problem by Jonathan

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.