Hello, everybody
I have problem with connect between perl and mssql.
I am using FreTDS,unixODBC,perl
config files
1.freetds.conf
2.
3.odbcinst.ini
4. perl script
When I try connect from shell to db
When I try connect from script I have error
What's wrong?
thanks for any help
I have problem with connect between perl and mssql.
I am using FreTDS,unixODBC,perl
config files
1.freetds.conf
Code:
[FreeTDS]
Description = MSSQL Driver
Driver = /usr/local/lib/libtdsodbc.so.0
Code:
[mssql]
Driver=FreeTDS
Trace=Yes
TraceFile=~/msssl.log
Server=x.x.x.x
Port=1433
Database=test
3.odbcinst.ini
Code:
[FreeTDS]
Description=MSSQL Driver
Driver=/usr/local/lib/libtdsodbc.so.0
UsageCount=2
Code:
$user = "sa";
$password = "123456";
$server = "mssql";
my $dbh = DBI->connect("DBI:Sybase:server=$server", $user, $passwd, {PrintError => 0});
my $sth;
unless ($dbh) {
die "ERROR: Failed to connect to server ($server).\nERROR MESSAGE: $DBI::errstr";
} else {
print "\n";
print "Successful Connection.";
print "\n\n";
}
When I try connect from shell to db
$ isql -v -s mssql sa 123456
Code:
[S1000][unixODBC][FreeTDS][SQL Server]Unable to connect to data source
[08S01][unixODBC][FreeTDS][SQL Server]Server is unavailable or does not exist.
[ISQL]ERROR: Could not SQLConnect
Code:
ERROR: Failed to connect to server (mssql).
ERROR MESSAGE: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (41)
Server mssql, database
Message String: Server is unavailable or does not exist.
What's wrong?
thanks for any help
