Hi Perl Monks!

My colleague created 1 table named <pc-name>\EXPRESS:Yield. I want to use DBI to connect it but somehow it couldn't >_<

i have created new connection in ODBC.ini as below:

[PC-NAME] Description=ODBC Data Sources Driver=FreeTDS Port=1433 Server=PC-NAME\SQLEXPRESS TDS_Version=7.1 Trace=No
My code to connect to the SQLEXPRESS:
$dbh=DBI->connect("dbi:MTODBC:PC-NAME:Yield","<usr>","<pw>") || die "$ +DBI::errstr\n";

Error message as below:

checkErrorODBC3 E SQLException: SQLState=[08001] Code=[0] Msg=[[mtodbc +]: Connecting: [unixODBC][FreeTDS][SQL Server]Unable to connect to da +ta source] DBI connect('PC-name:Yield','usr',...) failed: (mtodbc): Connecting: [ +unixODBC][FreeTDS][SQL Server]Unable to connect to data source (SQLST +ATE:08001) (CODE:0) (SEVERITY:SQLException) DBD: [dbd_db_login6/checkOutConnectionW(login)] RetCode=[-1] at ../dat +a_extraction_sqlite.pl line 615 (mtodbc): Connecting: [unixODBC][FreeTDS][SQL Server]Unable to connect + to data source (SQLSTATE:08001) (CODE:0) (SEVERITY:SQLException) DBD: [dbd_db_login6/checkOutConnectionW(login)] RetCode=[-1]

Can any1 help me to improve my knowledge on this? im able to connect his database in SSMS but why my unix cant~~ >_<

Appreciate ur feedback!


In reply to Use DBI for pc-name\SQLEXPRESS by wcyoong

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.