S
Savas Ates
i have a website... when a user sign up my site
sql="UPDATE users set status=1 WHERE userid = '&username&';"
but when a user leave my site i want to adjust status as =0 in my database
and when user click another user he must see his status
to make this onsession end and on application .end i used codes below.. but
it doesnt workk. what is the problem. i look at aspfaq.com but i didnt find
any solution... how can i solve this problem.. with any different idea??
help me please..
Sub Application_OnEnd
set sodb = Server.CreateObject("ADODB.Connection")
sodb.Open "PROVIDER=SQLOLEDB;Initial Catalog=friends;User Id=sa
;password=;Data Source=localhost"
Set cmdTemp = Server.CreateObject("ADODB.Command")
cmdTemp.CommandType = adCmdText
Set cmdTemp.ActiveConnection = sodb
cmdtemp.CommandText = "UPDATE users set status=0 WHERE userid = 'savas';"
set setUserOffline = Server.CreateObject("ADODB.Recordset")
setUserOffline.Open cmdTemp, , adOpenStatic, adLockOptimistic
sedb.close
set sodb = nothing
End Sub
Sub Session_OnEnd 'Runs when a user's session times out or quits
your application
set sodb = Server.CreateObject("ADODB.Connection")
sodb.Open "PROVIDER=SQLOLEDB;Initial Catalog=friends;User Id=sa
;password=;Data Source=localhost"
Set cmdTemp = Server.CreateObject("ADODB.Command")
cmdTemp.CommandType = adCmdText
Set cmdTemp.ActiveConnection = sodb
cmdtemp.CommandText = "UPDATE users set status=0 WHERE userid = 'savas';"
set setUserOffline = Server.CreateObject("ADODB.Recordset")
setUserOffline.Open cmdTemp, , adOpenStatic, adLockOptimistic
sedb.close
set sodb = nothing
End Sub
sql="UPDATE users set status=1 WHERE userid = '&username&';"
but when a user leave my site i want to adjust status as =0 in my database
and when user click another user he must see his status
to make this onsession end and on application .end i used codes below.. but
it doesnt workk. what is the problem. i look at aspfaq.com but i didnt find
any solution... how can i solve this problem.. with any different idea??
help me please..
Sub Application_OnEnd
set sodb = Server.CreateObject("ADODB.Connection")
sodb.Open "PROVIDER=SQLOLEDB;Initial Catalog=friends;User Id=sa
;password=;Data Source=localhost"
Set cmdTemp = Server.CreateObject("ADODB.Command")
cmdTemp.CommandType = adCmdText
Set cmdTemp.ActiveConnection = sodb
cmdtemp.CommandText = "UPDATE users set status=0 WHERE userid = 'savas';"
set setUserOffline = Server.CreateObject("ADODB.Recordset")
setUserOffline.Open cmdTemp, , adOpenStatic, adLockOptimistic
sedb.close
set sodb = nothing
End Sub
Sub Session_OnEnd 'Runs when a user's session times out or quits
your application
set sodb = Server.CreateObject("ADODB.Connection")
sodb.Open "PROVIDER=SQLOLEDB;Initial Catalog=friends;User Id=sa
;password=;Data Source=localhost"
Set cmdTemp = Server.CreateObject("ADODB.Command")
cmdTemp.CommandType = adCmdText
Set cmdTemp.ActiveConnection = sodb
cmdtemp.CommandText = "UPDATE users set status=0 WHERE userid = 'savas';"
set setUserOffline = Server.CreateObject("ADODB.Recordset")
setUserOffline.Open cmdTemp, , adOpenStatic, adLockOptimistic
sedb.close
set sodb = nothing
End Sub