Did you go into Start|Settings|Control Panel|Data Sources(ODBC) and setup a DSN to your database? In my experience with ODBC, you have to create a system DSN. I've tried creating user DSNs with less luck, but I haven't pursued the matter in depth. Your DSN will need to have the database connection, username, password, etc, since you're relying completly on the DSN to supply that information (you can override it in the ODBC connection statement, if you like).

If this doesn't help, I can fish up an example of a working ODBC connection, along with a correctly specified DSN, if you like.

Two other points: Preceeding your code with <code> and </code> tags will make it more readable. Also, can you provide the line number the error occurred on? I'm not sure that your subject of the topic and the error you're reporting may necessarily correspond.

--Chris

e-mail jcwren

In reply to (jcwren) Re: Win32::ODBC undefined DSN by jcwren
in thread Win32::ODBC undefined DSN by wabranty

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.