Hi all,
I am trying to track all my members of my website.
I have a global.asa file:
Code:
<script language="vbscript" runat="server">
Sub Application_OnStart
Application("Conn") = "connection string"
Application("Now") = Date() & " " & Time()
End Sub
Sub Session_OnStart
Session.Timeout = 20
if session("ManagerName")<>"" then
SQL = "Insert Into tbl_ManagerTracker (col_timeStart) Values('col_timeStart')"
Set MM_insert = Server.CreateObject("ADODB.Command")
MM_insert.ActiveConnection = Application("Conn")
MM_insert.CommandText = SQL
MM_insert.Execute
MM_insert.ActiveConnection.Close
Set MM_insert = Nothing
end if
End Sub
Sub Session_OnEnd
Set ManagerEnd = Server.CreateObject("ADODB.Recordset")
ManagerEnd.ActiveConnection = Application("Conn")
ManagerEnd.Source = "SELECT col_timeEnd FROM tbl_Tracker where col_timeStart ="&col_timeStart&" "
ManagerEnd.Locktype = 3
ManagerEnd.Open()
ManagerEnd.fields("col_timeEnd")= Application("Now")
ManagerEnd.update()
ManagerEnd.close()
End Sub
</script>
First of all, my session("ManagerName") been set up by user login, but it's value getting null while the global.asa running.
Then, Sub Session_OnEnd command seems not to be working at all...
I know it is a quite old topic, but please please help!!! Thanks..,