If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Please Help!! Session_OnEnd

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-07-03, 21:16
wrtagros wrtagros is offline
Registered User
 
Join Date: Sep 2003
Posts: 5
Unhappy Please Help!! Session_OnEnd

I have the this script on my Session_OnEnd

This line Application("ActiveUsers") = Application("ActiveUsers") - 1 is working properly

but the database updating is not working... but when i place this code on Session_OnStart the database updating is working properly

How session_onEnd is trigger? i believe its when the time of the session runs out? or when the user cllose his window or leave the site?

Please help

Thanks in adavnce!!!



Sub Session_OnEnd
' Decrease the active visitors count when the session ends.
Application.Lock
Application("ActiveUsers") = Application("ActiveUsers") - 1

set cnnPoll= server.createobject("adodb.connection")
cnnPoll.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SERVER.MapPath("/db/db.mdb")& ";"
set rsLogin = server.createobject("adodb.recordset")

sql = "update member set online = 1 where id_member = 1"
' & Session("Id")
set rsLogin = cnnPoll.execute(sql)


set rsLogin = nothing
set cnnPoll = nothing

Application.UnLock

End Sub
Reply With Quote
  #2 (permalink)  
Old 10-09-03, 22:55
wrtagros wrtagros is offline
Registered User
 
Join Date: Sep 2003
Posts: 5
Help!??? :<

Still no reply!?
Reply With Quote
  #3 (permalink)  
Old 10-13-03, 02:20
buzzter66 buzzter66 is offline
Registered User
 
Join Date: Nov 2002
Location: Houston, Texas
Posts: 85
Wish I could help...

Sorry dude, but I'm new to this myself. Is this code in your Global ASA file? I'll need to do something like this soon (associate an even to Session_OnEnd) and have no idea how to get it to work because I can't post to the Global ASA file (I'm using a shared Webhost).
Reply With Quote
  #4 (permalink)  
Old 10-15-03, 14:48
jlot6 jlot6 is offline
Registered User
 
Join Date: Sep 2003
Location: Newark, Vermont
Posts: 20
There is an extra quote on this line of code:
Code:
sql = "update member set online = 1 where id_member = 1" 
' & Session("Id")
It should be this:
Code:
sql = "update member set online = 1 where id_member = 1" & Session("Id")
Hope this helps...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On