Here's more or less how I've been doing it...
$DSN='DSN=MyDefinedOdbc;UID=MyLogin;PWD=MyPassword';
if(!($db = DBI->connect("dbi:ODBC:$DSN"))) {
print "Unable to connect to $DSN\n";
exit;
}
-----Original Message-----
From: John.F.Kennedy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 21, 2002 10:54 AM
Cc: [EMAIL PROTECTED];
[EMAIL PROTECTED];
[EMAIL PROTECTED];
[EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: problem connecting to SQL server 2000
I am having a problem connecting to SQL server 2000 using DBI. Below are my
code and the error message I get could some point me in the right direction.
sub Connect_To_DataBase
{
my ($continue,$dsn);
$continue = $TRUE;
Create_Log("null","Attempting to connect to My Database");
$dsn = "Driver={SQL Server};Server =MyServerName;Database=
MyDatabaseName ";
$DBH = DBI->connect("dbi:ODBC:$dsn","username", "password",
{
RaiseError => 0,
PrintError => 0,
AutoCommit => 0
} ) or
Create_Error_Log($DBH::errstr,1,"DFD1_A",1033,"DFD1"),$continue = $FALSE;
return $continue;
}
Error : [Microsoft][ODBC Driver Manager] Invalid string or buf
Thanks
John Kennedy
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/2002
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs