asp中在线用户显示问题
我运行时显示
Microsoft VBScript 运行时错误 错误 '800a01f4'
变量未定义: 'rstActiveUsers'
/汉德车桥售后服务系统/user_show.asp,行 3
但是 'rstActiveUsers‘已经在global.asa中定义了啊
下面是我的global文件
<object runat="Server" scope="Application"
id="rstActiveUsers" progid="ADODB.Recordset">
</object>
<script language="VBscript" runat="Server">
Sub Application_OnStart()
Const adInteger = 3
Const adVarChar = 200
Const adDate = 7
rstActiveUsers.Fields.Append "id", adInteger
rstActiveUsers.Fields.Append "ip", adVarChar, 15
rstActiveUsers.Fields.Append "browser", adVarChar, 255
rstActiveUsers.Fields.Append "started", adDate
rstActiveUsers.Open
End Sub
Sub Session_OnStart()
Session.Timeout = 20
Session("Start") = Now()
If Not rstActiveUsers.EOF Then rstActiveUsers.MoveLast
rstActiveUsers.AddNew
rstActiveUsers.Fields("id").Value = _
Session.SessionID
rstActiveUsers.Fields("ip").Value = _
Request.ServerVariables("REMOTE_HOST")
rstActiveUsers.Fields("browser").Value = _
Request.ServerVariables("HTTP_USER_AGENT")
rstActiveUsers.Fields("started").Value = _
Now()
rstActiveUsers.Update
End Sub
Sub Session_OnEnd()
Const adSearchForward = 1
Const adBookmarkFirst = 1
Const adAffectCurrent = 1
rstActiveUsers.Find "id = " & Session.SessionID, _
0, adSearchForward, adBookmarkFirst
If Not rstActiveUsers.EOF Then
rstActiveUsers.Delete adAffectCurrent
End If
End Sub
</script>
------解决方案--------------------
VB不会 如果用其他脚本 我可以帮你忙