回 帖 发 新 帖 刷新版面

主题:请高手看看!!急!谢谢了!

Microsoft JET Database Engine 错误 '80004005' 
操作必须使用一个可更新的查询。 

/ltxx.asp,行 117 


我只是换了个服务器空间,就这样了!


117如下:

<%
set rs=conn.execute("select maxonline,maxtopic,maxontime,nowtime,todaynum,topicnum,allnum,usernum,newuser from config")
newuser=rs("newuser")
newuser=split(newuser,"|")
maxonline=rs("maxonline")
maxontime=rs("maxontime")
realnowtime=formatdatetime(now()+timeset/24,2)
nowtime=replace(rs("nowtime"),",","")
if FormatDateTime(conn.execute("select nowtime from config")(0),2)<>realnowtime then
conn.execute("update bdinfo set todaynum=0") [color=800000] (117)[/color]
conn.execute("update config set todaynum=0,nowtime='"&realnowtime&"'")
conn.execute("update [user] set tnum=0")
if Date()-weekday(date(),2)+1=date() then conn.execute("update [user] set wnum=0")
end if
%>

回复列表 (共6个回复)

沙发

顶上去!!

板凳

如果原来不会报错,那就证明代码没问题。

查查看在空间的数据库中,你是否有写权限。

3 楼

一看就晕倒,得告诉要什么功能

4 楼

检查过了,不是数据库的权限的问题,还有其他的可能吗?高手指导一下!

5 楼

如果使用execute 无法进行更新操作 请试着直接使用
rs.open sql,conn,1,3
rs("todaynum")=.....
rs.update
.....
的语法进行更新操作

如果同样这个也出错 请查看数据库权限(ACCESS的话比较简单,而SQLSERVER的话需要考虑到用户)
权限没有问题,请把数据库下载到本地查看是否已经破坏.(ACCESS的话直接打开会提示修复)
检查数据库表中对应的字段是否和程序的需求是相符合的.
检查数据库连接的语句,如果换种连接写法看看是否还有有错误.
如果问题依旧... 请找高手!

6 楼

郁闷还是没找到根本问题!

我来回复

您尚未登录,请登录后再回复。点此登录或注册