You may want to do a DSN less connection instead of relying on a preconfigured DSN. This allows you to move and run this script to any machine with the DB Client.
use warnings;
use strict;
use Win32::ODBC;
my $DSN = "driver={SQL Server};server=myservername;database=mydb;uid=s
+a;pwd=xxxx";
if (!(my $input = new Win32::ODBC($DSN))){
print "Failure opening connection. \n\n";
exit();
}else{
print "Success (connection #", $input->Connection(), ")\n\n";
}
|