IMO only use a global.asa if you need to. Not all systems need one. Example - Here is the global.asa from the system I am working on at the moment. The only reasons I use one here is:
> extend the session timout for this web system only (can be done in IIS of course)
> set the LCID to ensure a dd/mm/yyyy format is used no matter what the server is set to
- this is very handy, no more date format problems!
> to ensure I have a session based hit couter
-ONE entry is made to the database for each unique visitor, as you can see in the code.
Anhow here is the cut n paste code:
<script runat=server language=VBScript>
Sub application_onStart
end sub
sub session_onStart
Session.Timeout = 40
Session.LCID = 3081
application.lock
Set Conn = Server.CreateObject("ADODB.Connection")
GetConnectionString = "Provider=SQLOLEDB.1; Password=XXX; Persist Security Info=True; User ID=XX; Initial Catalog=myDBName; Data Source=myMachineName"
Conn.Open GetConnectionString
SQL = "update hits SET hits=(hits+1) WHERE id=1;"
Conn.execute(SQL)
Conn.close
set Conn = nothing
application.unlock
End Sub
Sub Session_OnEnd
End Sub
Sub Application_OnEnd
End Sub
</script>
Wind is your friend
Matt
www.elitemarquees.com.au