操作必须使用一个可更新的查询
<%Sub onlineuser()
statid = replace(Request.ServerVariables("REMOTE_HOST"),".","")
session("statid") = statid
filename = request.ServerVariables("SCRIPT_NAME")
postion = InstrRev(fileName,"/")+1
useract = Mid(fileName,postion)
dim act
select case useract
case "adminthread.asp"
act = "管理贴子"
case "allface.asp"
act = "查看论坛所有头像"
case "announcement.asp"
act = "查看论坛公告"
case "board.asp"
act = "查看论坛版块"
case "delpost.asp"
act = "删除贴子"
case "delthread.asp"
act = "删除主题"
case "editpost.asp"
act = "编辑贴子"
case "editthread.asp"
act = "编辑主题"
case "faq.asp"
act = "查看论坛帮助"
case "index.asp"
act = "论坛首页"
case "login.asp"
act = "登录论坛"
case "lostpass.asp"
act = "找回密码"
case "movethread.asp"
act = "移动主题"
case "newreply.asp"
act = "发布回复"
case "newthread.asp"
act = "发布新的主题"
case "newvote.asp"
act = "发布新的投票"
case "onlinelist.asp"
act = "会员在线状态"
case "pm.asp"
act = "使用悄悄话"
case "register.asp"
act = "正在注册"
case "search.asp"
act = "使用论坛搜索"
case "showposterip.asp"
act = "查看用户IP"
case "showthread.asp"
act = "浏览贴子"
case "showvote.asp"
act = "浏览投票结果"
case "user.asp"
act = "查看会员信息"
case "usercp.asp"
act = "使用控制面板"
case "userlist.asp"
act = "查看会员列表"
case "logs.asp"
act = "论坛日志"
End select
'response.Write(act)
userhidden = request.Cookies(JBBMasterCookies)("userhidden")
if userhidden="" or Not(ISnumeric(userhidden)) then userhidden = 0
if BoardID="" then BoardID=0
if threadID="" then threadID=0
thread_title = replace(thread_title,"'","''")
'====================================================
if useronline = true then
set rs = conn.ExeCute("select userid From JBB_online where userid="&userid)
if rs.Eof Or rs.Bof then
sql="insert into JBB_online(uname,times,statid,usergroup,userid,userIP,title,thread_title,threadID,BoardID,act,userhidden) values('"&username&"','"&Now()&"',"&statid&","&usergroup&","&userid&",'"&userIP&"','"&title&"','"&thread_title&"',"&threadID&","&BoardID&",'"&act&"',"&userhidden&")"
else
sql="update JBB_online set times='"& Now() &"',statid="& statid &",thread_title='"& thread_title &"',threadID="& threadID &",title='"& title &"',BoardID="& BoardID &",act='"& act &"',userhidden="& userhidden &" where userid="&userid
End if
set rs = Nothing
sql2="update JBB_user set lastactivity='"& Now() &"' where userid="&userid
conn.execute(sql2)
else
set rs = Conn.ExeCute("select statid from JBB_online where statid='"& statid &"' and Uname='游客'")
if rs.Eof Or rs.Bof then
sql="insert into JBB_online(uname,times,statid,usergroup,userIP,title,thread_title,threadID,BoardID,act) values('游客','"&Now()&"','"&statid&"',6,'"&userIP&"','"&title&"','"&thread_title&"',"&threadID&","&BoardID&",'"&act&"')"
else
sql="update JBB_online set times='"&Now()&"',thread_title='"&thread_title&"',threadID="&threadID&",title='"&title&"',BoardID="&BoardID&",act='"&act&"' where statid='"& statid &"' and Uname='游客'"
End if
set rs = Nothing
End if
conn.ExeCute(sql) ********** 第91行
'==========================================================
Conn.Execute ("delete from JBB_online where DATEDIFF('s', times, '"& now() &"') > "& BBS_Config(14) &"*60")
End Sub
%>
错误提示:
Microsoft OLE DB Provider for ODBC Drivers 错误 '80004005'
[Microsoft][ODBC Microsoft Access Driver] 操作必须使用一个可更新的查询。
online.asp,行 91
先 谢谢 各位 了