Page 251 - DCAP402_DCAO204_DATABASE MANAGEMENT SYSTEM_MANAGING DATABASE
P. 251
Database Management Systems/Managing Database
Notes #
# The CGI::CARP module has a nice
# feature called “fatalsToBrowser”
# that sends error messages to the
# web browser window so that the
# user does not get a meaningless
# 500 Server Error message.
use DBI;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
# Setup some implementation
# specific variables. $dbname
# is going to be the Data
# Source name that you
# assigned to your database in
# the 32Bit ODBC Control
# Panel plus the DBI:ODBC
# pre-tag. I did not setup
# any security on my database
# since it is only for local
# testing, so we can leave
# those values blank.
$dbName = “DBI:ODBC:MyCompany”;
$dbUserName = “”;
$dbPassword = “”;
# We will create a new CGI
# object and use it to send
# out the HTTP header and
# to parse out the incoming
# form variables “requestType”
# and “sql”. You will see
# where those form variables
# come from in just a bit.
$dataIn = new CGI;
$dataIn->header();
244 LOVELY PROFESSIONAL UNIVERSITY