[thelist] [ASP Question] Session_OnStart

Anthony Johnston . Antix tech at antix.co.uk
Fri Oct 18 11:31:00 CDT 2002

Have you got an application created on the directory the global.asa is


-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Jacques Capesius
Sent: 18 October 2002 16:48
To: 'Evolt'
Subject: [thelist] [ASP Question] Session_OnStart

Hi folks,

I'm trying to do a little stat collecting, using a Session_OnStart trigger
to record in a database the time someone first accessed the site. I figure,
having a global.asa file that looked like this would do the trick...

Sub Session_OnStart
	Set SessionCon = Server.CreateObject("ADODB.Connection")
	SessionCon.Open "Driver={SQL Server}; SERVER=blaa;
DATABASE=whatever; UID=jondoe; PWD=aintellin;"
	SQLQuery = "INSERT INTO Session_stats (sessionID, session_start) "&_
			   "VALUES ('"&Session.SessionID&"',getdate())"
	set theRS = SessionCon.Execute(SQLQuery)
	set theRS = Nothing
	set SessionCon = Nothing
End Sub

As is probably obvious to some of you ASP Wizards, this code isn't
executing, and i'm not really sure why. I'm kinda new to adding code to the
global.asa file and using ASP's version of event handling, so any advice you
folks could give would be greatly appreciated. thanks!
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !

More information about the thelist mailing list