in reply to PERL and MS-SQL Server 2000
This is the code that I have (using DBD::ODBC) which works just fine:
sub connectdb { my ($data_source, $database, $user_id, $passwd ) = qw( server_hostname_or_IP database_instance username password +); my $conn_string = "driver={SQL Server};Server=$data_source;Databas +e=$database;UID=$user_id;PWD=$passwd"; my $dbh = DBI->connect( "DBI:ODBC:$conn_string" ) or die $DBI::err +str; return $dbh; }
Cheers,
Darren :)
PS. It's when you try connecting to a MS-SQL server from a Linux box that the fun really begins! But in that case, I found this tutorial to be an absolute godsend :)
|
|---|