The Database Connection

sub connectToDB {

# Make the connection

# Username and password are stored separately

$dbh = DBI->(

$main::connect_str,

$main::dbuser,

$main::dbpass)

or

die print "Failed to connect to database server " . $DBI::errstr ;

return $dbh;

}

Previous slide Next slide Back to first slide View graphic version