Ohio.gov logo

Digital Ohio Home


Home
Contacts

Hosting Services

   Hosting Accounts Request
      Send a Request
    (2 hr response M-F 8-5)
   Send a Suggestion
Accessibility
Pre-development
Checklist


Directory Structures
& Shortcuts
Web Applications
& Global.asa files
.Net 1.1
Usage Reports
Statewide IT Policy

Tools
   JMail
   FTP
    Meta Tag Generator
General Reference
Images Resources
   Discover Logo


Web Hosting - Database Applications

Global.asa Files

"The global.asa file is a script file that is associated with each Web Application on the Web server. A Web Application is a collection of ASP and HTML pages all contained within a folder on the server. ... The global.asa file resides in the root folder of a Web Application and is run each time the Application is started or stopped. It is also run each time an individual user starts or ends a browser session that accesses the Application's Web pages. The global.asa file is therefore used to execute code, initialize variables, connect to databases, or perform any other tasks that need to happen only at the start or end of an Application or Session." http://www.devguru.com/features/knowledge_base/a100202.html

In addition to having a Global.asa file you must also include the connection string in each of your ASP pages that will communicate with the database.

Global.asa

Please note that \DIR\AGY\APP\DB in the Data Source line will need to be customized to indicate the file location of your database.

DIR - Directory - either DataRead or DataWrite
AGY - Directory - Agency Directory
APP - Directory - Directory containing the application database. Usually the same name as the directory containing the application web pages.
DB - Database name


Note: if you update the code above so that it does not wrap be sure you remove the continuation characters ( & _  ). If you don't you will get an error message indicating that your database connection has not been established.

Database Connection String


Database Connectivity Test

The sample code below can be used to confirm the database connection after the application object has been created by the Digital Ohio staff.


Application Object Test

To confirm that the Application Object has been created and is running
1) add the line [ Application("asacheck") = "running" ] to your global.asa file as shown below, and
2) create a test file, also shown below.