|
|
|
|
|
| | |
|
Active Server Pages help tutorial how to ASP Help ASP Tutorials ASP Programming ASP Code - ASP Free CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
recordset problem |
From: |
caz |
Date: |
9/10/2001 3:23:47 PM |
IP: |
192.223.186.84 |
--------------------------------------------------------------------------------
Hi,
my problem is kind of hard to explain but I hope everyone is able to understand. If anyone doesn't, please feel free to email me and ask questions because I am really stuck with this one and basically could do with all the help I can get!
Basically, I am working on a tool that tracks our users' usage of an application and what I am trying to do at the moment is using VBScript list the last ten sessions for a particular user.
What I eventually want to end up is the following format:
eg
Session Started Session Ended
2:34 PM 2:50PM
3:35 PM 4:15PM
etc...
Every single request that a user makes is tracked in a database so I am using a recordset object to retrieve the results
My SQL statement is as follows:
sql = "SELECT * FROM event_log" & _
"WHERE (event_id = 1 OR event_id = 2 OR event_id = 10 OR event_id = 0)" & _
"AND user_id="ABC" & _
"ORDER BY event_time DESC"
The event_id's mean the following:
1 = login success
2 = login failure
10 = logout
0 = regular page request once the user is logged in
A session start with a login failure or if there is none, a login success
A session ends with either a logout or when the last request was more than 20 minutes ago
The easiest way to explain is to give an example of a recordset and show the expected results
[b]Event# event_time event_id
1 2:34 0
2 3:05 2
3 3:07 2
4 3:08 1
5 3:09 0
6 3:11 10
7 3:15 1
8 |
|
|

|
|
|
|
|
|
|
|
|
|