Hi all, I'm trying to set up a dsnless connection to SQL Server using the following code
use DBI;
my $DSN = 'driver={SQL Server};Server=LAB135_20143;database=test;uid=xxx;pwd=xxx;';
my $dbh = DBI->connect('DBI:ODBC:$DSN') # quit if not able to connect
or die "Fatal Error: Couldn't connect to database: . DBI->errstr";
I keep getting this error message
DBI->connect($DSN) failed: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (SQL-IM002)(DBD: db_login/SQLCo
nnect err=-1) at dsnless.pl line 3
This seems to be the correct syntax for setting up a dsnless connection but it doesnt seem to be working. Also, I would like to point out, I also currently have a system DSN set up dor that database.
Someone please help.
use DBI;
my $DSN = 'driver={SQL Server};Server=LAB135_20143;database=test;uid=xxx;pwd=xxx;';
my $dbh = DBI->connect('DBI:ODBC:$DSN') # quit if not able to connect
or die "Fatal Error: Couldn't connect to database: . DBI->errstr";
I keep getting this error message
DBI->connect($DSN) failed: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (SQL-IM002)(DBD: db_login/SQLCo
nnect err=-1) at dsnless.pl line 3
This seems to be the correct syntax for setting up a dsnless connection but it doesnt seem to be working. Also, I would like to point out, I also currently have a system DSN set up dor that database.
Someone please help.