Gossamer Forum
Home : General : Perl Programming :

MSSQL and ODBC connection

Quote Reply
MSSQL and ODBC connection
I'm trying to make an ODBC connection to a MSSQL database and am hoping someone could shed some light.

The MSSQL database "DSAR" exists on NT server "ASSR_IMGDB1"

Apache web server is running on NT server "NT02", MySql and LinksSQL (utilizing MySql) is running on "NT02". There is also an ODBC connection named "OBSERVER" which connects to the database on "ASSR_IMGDB1" on this server. The connection tests okay and a thick client runs on NT02 which utilizes the ODBC connection. (ANSI Nulls, Paddings and Warnings are NOT checked). DBD::ODBC has been installed.

my test connect/disconnect routine is -

sub {
use DBI;
my $dbh = DBI->connect("DBI:ODBC:database=OBSERVER;host=ASSR_IMGDB1", "", "", {'RaiseError' => 1});
$dbh->disconnect;
}

I get the error

DBI->connect(database=OBSERVER;host=ASSR_IMGDB1) failed: [Microsoft][ODBC Driver Manager] Invalid string or buffer length (SQL-S1090)(DBD: db_login/SQLConnect err=-1) at (eval 10) line 3

What am I missing? If I change the database or host names I get a 'datasourse not found' error. I would have thought the host should be "NT02" since this is where the ODBC connection exists.

Any help is appreciated.Earl
Subject Author Views Date
Thread MSSQL and ODBC connection Super 3981 Mar 14, 2002, 10:08 AM
Thread Re: [Super] MSSQL and ODBC connection
Alex 3813 Mar 14, 2002, 10:58 AM
Post Re: [Alex] MSSQL and ODBC connection
Super 3788 Mar 14, 2002, 11:32 AM