Try no apostrophes around the value of your UID and PASS, e.g.
$dsn="driver={$driver};database=$db;server=$server;UID=user;PASS=pass";

---------------FROM-------------------
David R. Miller
Manager, Computer-Based Testing
Medical Council of Canada
[EMAIL PROTECTED]
(613) 521-6012
(613) 521-9722 (fax)
-----------------------------------------

Original message:
Message: 2
From: "Daniel Cohen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: DSN-less DBI connection
Date: Mon, 5 Feb 2001 11:55:39 -0500

Hi all,
Im trying to do a simple dsn-less conenction to an sql database:
$driver = 'SQL Server';
$db = 'database_name';
$server = 'server_ip';
$dsn =
"driver={$driver};database=$db;server=$server;UID='user';PASS='pass'";
$dbh = DBI->connect("dbi:ODBC:$dsn") or die;

Though, it seems right to me, I keep getting this error:

DBI->connect(driver={SQL
Server};database=database_name;server=database_name;UID='user';PASS
='pass') failed: [Microsoft][ODBC Driver Manager] Invalid string or buffer
length (SQL-S1090)(DBD: db_login/SQLConnect err=-1) at E:\dsnless_test.pl
line 6

Died at E:\dsnless_test.pl line 6.

**Ive replaced the username, password and database name, and servers with
fake values, so those represented above are not what Im actually using -
just so you dont think thats the problem**

Any help you can give is most appreciated.
Daniel
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to