Hi All,

I need to develop an application which should connect to MSSQL Database and execute few queries and display them on the screen.

Installed the following perl modules successfully on Linux server

1. DBI 1.54

2. DBD::Sybase 1.08

3. Free TDS 0.82

Also set the Sybase env variable and written a small script initially to test the connection using perl script. We are able to connect to the DB from the CLI with freetds using the below command

./tsql -p 1433 -S DB -U test -P test locale is "C" locale charset is "ANSI_X3.4-1968" 1>
But unable to connect to the database through script.

Below is a part of the script used to connect to the Database, please review the script and let me know if I am doing any thing incorrect.

use DBI; my ($user_id,$pass,$dsh,$sth,$dbh); $user_id = 'test'; # username $pass = ''; #password $hostname='station100'; #hostname $port='1433'; # mssql server port $databasename='HHC_PORTAL_GUI'; # database name $tablename='Services'; $ser='HHC_DS'; # Connect to the MS SQL database $dbh = DBI->connect("dbi:Sybase:host=$hostname;port=$port;serv +er=$ser;database=$databasename", $user_id,$pass,{PrintError=>'1',Rais +eError=>'1'});

Thanks In Advance

Sushil Kumar


In reply to Unable to connect to MSSQL DB using DBD::Sybase by msk_0984

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.