Unsuccessfully I have been trying to connect to a remote Sybase database called ‘LNB_HHH_APP’ by using the Win32::ODBC module!

The ODBC administrator software on my local WinXP PC confirms that a valid user DSN name been created for the Sybase database, and drive listed of this database is the ‘DataDirect 4.0 Sybase Wire Protocol’. I have successfully tested the connection to the database by using the ‘Test Connect’ within the ODBC admin software after supplying the required login credentials.

I used the following bit of code to connect to the database – I have used the same code successfully in the past to connect to other MS Access database, so I thought that I could use it to connect to the Sybase instead! Maybe not.
use strict; use warnings 'all'; use Win32; use Win32::ODBC; my $dsn = "LNB_HHH_APP"; if (!(my $db = new Win32::ODBC($dsn))) { print "\nError connecting to $dsn\n\n"; print "\nError: " . Win32::ODBC::Error() . "\n"; exit; }
The errors I received were;
Error connecting to LNB_HHH_APP Error: [911] [] "[MERANT][ODBC Sybase Wire Protocol driver]Insufficien +t information to connect to the data source."
Can someone please shed some light on to this and why am I not able to connect successfully to the Sybase database? Is it to do with credentials? And How can I incorporate the user name and password to connect to the database within my script? Or do I need different Perl module for Sybase or another driver?

Thanks for the help

In reply to Connecting to Sybase using Win32::ODBC by blackadder

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.