Open rchekaluk opened 10 years ago
A possibly relevant clue from https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues/168#issuecomment-4204268:
You are using dataserver and host, one trumps the other.
I have similarly found that the script can't connect to a MS SQL server using IP and port. However I don't receive that error, in fact there is nothing more helpful than "(no error string)", even enabling full DBI trace adds little. I tried many variations of the connection string to no avail. I thought it might be that the TDS version is incorrect or a bug in one of the libraries.
The only way it works for me is using server name with matching entries in freetds.conf, which is kind of annoying as more servers are involved.
I can confirm the problem Tested with DBD::Sybase: 1.15 freetds: 0.95.67 It looks like the work on DBD::Sybase has stopped.
use DBI;
use strict;
my $username = "sa";
my $password = "password";
my $dsn = "DBI:Sybase:;host=myhost.com;port=61234";
if (my $dbh = DBI->connect(
$dsn, $username, $password,
{ RaiseError => 1, AutoCommit => 0, PrintError => 1 })) {
printf "connection succeeded\n";
} else {
printf "connection failed\n";
}
Error message:
DBI connect(';host=myhost.com;port=61234','sa',...) failed: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (44)
Server , database
Message String: Server name not found in configuration files.
OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (78) NUMBER = (45)
Server , database
Message String: Unknown host machine name.
Problem solved in freetds https://github.com/FreeTDS/freetds/commit/49333d5b35190ca27c0d53d3648276b012887812
I'm unable to connect to MS SQL when using the --hostname switch:
However, I am able to connect when using the --server switch:
tsql successfully connects using both the -H and -S switches:
mssql_miniscript.pl fails in the same manner as reported here.
Versions