msk_0984 has asked for the wisdom of the Perl Monks concerning the following question:
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
But unable to connect to the database through script../tsql -p 1433 -S DB -U test -P test locale is "C" locale charset is "ANSI_X3.4-1968" 1>
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unable to connect to MSSQL DB using DBD::Sybase
by derby (Abbot) on Aug 14, 2009 at 13:54 UTC |