Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Posts
    5

    Unhappy Unanswered: 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

  2. #2
    Join Date
    Sep 2003
    Posts
    5

    Help!??? :<

    Still no reply!?

  3. #3
    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).

  4. #4
    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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •