Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_database_setup thread: session_onend in global.asa - database execution


Message #1 by keiw@m... on Mon, 19 Nov 2001 09:57:18
Hello,



All I'm trying to do is store some data into the database when a session 

is abandoned/timed out but I'm having a real hard time with it.  



I don't know if this is a good way to go about this problem but inside the 

session_onend function, I've used application variables to update where it 

has been executed so far.  For some odd reason, the last Application

("message") = "Ended" gets updated if it is BEFORE opening the 

connnection. But not after.



I'm using another file to retrieve the application variables.



<script language="vbscript" runat="server">

sub Application_OnStart



end sub

sub Application_OnEnd



end sub

sub Session_OnStart

	Application("message") = "Started"

end sub

sub Session_OnEnd

Application("message") = "Entered End"  'When you retrieve this variable 

after abandoning the session, this is what it spits out.

	Dim Conn, Rs

	Set Conn = Server.CreateObject("ADODB.Connection")

	Set Rs = Server.CreateObject("ADODB.Recordset")

	Conn.open "DSN=test_dsn;DATABASE=test;"

	Application("message") = "Ended"	'It never seems to reach 

here 

end sub

</script>



Has anybody done this sort of thing before?



Thanks,



William Keaton


  Return to Index