ASP Tutorials - Herong's Tutorial Examples - v5.10, by Dr. Herong Yang
Configuration File
This section describes the configuration file in ASP script to be used as an include file for the main ASP script page.
The easiest way to set up configuration files with ASP pages is to use include files. For hyBook, I used one include file, _config.inc, to maintain all configurable items:
<% ' _config.inc ' ' Configuration file ' hyBook version 2005.12.11 ' Copyright (c) 2005 by Dr. Herong Yang, http://www.herongyang.com/ ' Database connection Dim ogConn Set ogConn = Server.CreateObject("ADODB.Connection") ' Number of submits per IP per day Dim ngSubmitLimit ngSubmitLimit = 10 ' Default topic ID Dim ngDefaultTopicID ngDefaultTopicID = 14 ' Page title Dim sgPageTitle sgPageTitle = "hyBook Demo" ' Debugging flag Dim bgDebug, ogDebug bgDebug = False Set ogDebug = Nothing Sub dbConnect ogConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _ Server.MapPath("/cgi-bin/hyBook.mdb") If bgDebug Then Set oFileSys = Server.CreateObject("Scripting.FileSystemObject") Set ogDebug = oFileSys.OpenTextFile("\temp\hyBook.log", 8, True) ogDebug.WriteLine("Open data base connection.") End If End Sub Sub dbClose Set ogConn = Nothing If bgDebug Then ogDebug.WriteLine("Close data base connection.") ogDebug.Close End If End Sub %>
Note that:
Table of Contents
ASP (Active Server Pages) Introduction
IIS (Internet Information Services) 5.0
Managing Sessions with and without Cookies
scrrun.dll - Scripting Runtime DLL
Managing Response Header Lines
Calculation Speed and Response Time
Working with MS Access Database
►Guest Book Application Example