I've got a GLOBAL.ASA file that is presently counting Active Users (see below). However, now I have Browser Hawk installed on my dedicated server and I would like to add code to GLOBAL.ASA that records in an Access database for each user session whether the user has FLASH installed or not. The code to do this is basically this:
Set objConn = Server.CreateObject("ADODB.Connection")
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=path to database;"
objConn.Open ConnectionStringset bhObj = Server.CreateObject("cyScape.browserObj")
flash = bhObj.Plugin_Flash
if flash = 0 Then
objConn.Execute(" INSERT INTO browserstats ( flash ) SELECT -0 AS flashinst")
objConn.Execute("INSERT INTO browserstats ( flash ) SELECT -1 AS flashinst")
Set objConn = Nothing
What I'm unsure about is how to put this code into my present GLOBAL.ASA efficiently so that I only open the BrowserHawk object once, etc. Here is my present GLOBAL.ASA:
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
' Set our user count to 0 when we start the server
Application("ActiveUsers") = 0
' Change Session Timeout to 20 minutes (if you need to)
Session.Timeout = 20
' Set a Session Start Time
' This is only important to assure we start a session
Session("Start") = Now
' Increase the active visitors count when we start the session
Application("ActiveUsers") = Application("ActiveUsers") + 1
' Decrease the active visitors count when the session ends.
Application("ActiveUsers") = Application("ActiveUsers") - 1
Any suggestions very much appreciated!