or download this
my $userid = q{};
my $password = q{};
my $strCnn = "Provider=SQLOLEDB; Data Source=$Servername; Initial
+Catalog=$Tablename; Integrated Security=SSPI;";
$dbh = DBI->connect( "dbi:ADO:$strCnn", $userid, $password, { Rais
+eError => 1, AutoCommit => 0 } ) or
croak "Cannot connect: $DBI::errstr";