sowais has asked for the wisdom of the Perl Monks concerning the following question:
my $server_name = 'production\reporting'; my $database_name = 'test'; my $DSN = "driver={SQL Server};server=$server_name;database=$database_ +name;"; my $dbh = DBI->connect("dbi:ODBC:$DSN", {PrintError =>0, RaiseError => +1}); eval { if (!$dbh) { print "Could not connect to da +tabase: $DBI::errstr"; } if($dbh) { print "Connected to DB!!"; } my $sql = "INSERT INTO Count VALUES ()"; my $sth = $dbh->prepare($sql); $sth->execute(); }; if($@) { $dbh->disconnect(); QuitProgram("DB Failure: $@"); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Perl with Active Directory
by NetWallah (Canon) on Sep 03, 2013 at 22:58 UTC | |
Re: Perl with Active Directory
by locked_user sundialsvc4 (Abbot) on Sep 04, 2013 at 14:49 UTC | |
Re: Perl with Active Directory
by natxo (Scribe) on Sep 04, 2013 at 17:30 UTC | |
Re: Perl with Active Directory
by 5mi11er (Deacon) on Sep 05, 2013 at 16:13 UTC |