This topic is locked

who is online?

2/23/2007 8:38:50 AM
ASPRunnerPro General questions
D
dunga author

Is there any way to know who uses the database, and from which IP?

thank you

Sergey Kornilov admin 2/26/2007

This is the part of my security related suggestions.
In short you need to have a separate table or an additional field in login table which tracks users activity like LastAccess datetime.

This field needs to be updated when user accesses any ASP page and cleared after log out.
"Who's on script" can be placed to header.asp file and displays a list of users that had any activity last 20 or so minutes.

N
nrijo 8/17/2007

LastAccess Datetime is exactly what my boss approached me today about.
Any idea how it would be implemented in a ASP Runner website? I need to be able to keep track of when (datetime) each username logs into the website. So I can be able to create a report just in case we get audited.
Thanks

Sergey Kornilov admin 8/17/2007

Use AfterSuccessfulLogin Event to insert a record into log table.

Something like this will work:

strSQL = "insert into log (userid, lastaccesstime) values ('" & Session("UserID") & "',now())"

dbConnection.Execute strSQL
D
dunga author 8/25/2008

correct me if I am wrong please:
"login" table:
login

username

level

LastAccessTime - set as date/time in access
main table named "Student Tracking"

which has 20 fields + field called "login"
then
Use AfterSuccessfulLogin Event to insert a record into "login" table.

Something like this will work:
CODE

strSQL = "insert into login (login, lastaccesstime) values ('" & Session("UserID") & "',now())"

dbConnection.Execute strSQL
is this correct?
then
how to display this information(userID+LastaccessTime) on the Student Tracking table.
Ps. sorry if it has been duplicated, kind of urgent.

D
dunga author 8/25/2008

after numerous tries,
I have these errors:
-2147217900

Error description Syntax error in INSERT INTO statement.

URL /student tracking/login.asp

SQL query select * from [passwords] where [Login]='xyz' and [Password]='xyz'

Solution This commonly occurs when you have a field name that is a reserved word.
i have created additional table called it "lastitime"

added 3 fields:

ID

loggedas

lasttime
so you can see that the nmaes are not reserved.
in the SQL quert window I have added the folowing code:
[codebox]lasttime.loggedas,

lasttime.updatedon AS updatedon

FROM [Student Tracking]

INNER JOIN lasttime ON [Student Tracking].Login = lasttime.loggedas[/codebox]
in the Events screen

I have inserted the following code:
'** Insert a record into another table ****

strSQLInsert = "insert into lasttime (loggedas, updatedon) values ("' & Session("OwnerID")'"&,"'now()'")"

dbConnection.Execute strSQLInsert
And still get the error.
please help.

I know I am doing something wrong, not the application.

J
Jane 8/26/2008

Hi,
try to use following code:

'** Insert a record into another table ****

strSQLInsert = "insert into lasttime (loggedas, updatedon) values ('" & Session("OwnerID") & "',now())"

dbConnection.Execute strSQLInsert