在SQL Server下为什么不能更新数据?

hansonboy 2005-11-24 10:49:21
adssqlp="Select * from Advertisement_Ads where act=1 and class <> 0 and place23 order by time"
adsrsp.open adssqlp,Conn,1,3

这句系ACCESS数据库下可以更新的, 但用SQL SERVER就说
ADODB.Recordset 错误 '800a0cb3'

当前记录集不支持更新。这可能是提供程序的限制,也可能是选定锁定类型的限制。

...全文
188 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
hansonboy 2005-11-24
  • 打赏
  • 举报
回复
那里打错了,
adssqlp="Select * from Advertisement_Ads where act=1 and class <> 0 and place=23 order by time"
这样才对, 我程序里是没错的
friendlyFour 2005-11-24
  • 打赏
  • 举报
回复
adssqlp="Select * from Advertisement_Ads where act=1 and class <> 0 and place23 order by time"
这个中的order by前面那句and place23 什么意思
hansonboy 2005-11-24
  • 打赏
  • 举报
回复
数据集或其它的都全有的, 代码都正确的, 刚试过,不用 order by time就行,为什么在sql server下用order by就不能更新的,用过top好像也是
skycuilin 2005-11-24
  • 打赏
  • 举报
回复
你的数据集在哪里?
set adsrsp=server.createobject("adodb.recordset")
这个如果没写肯定recordset对象会出错
netrope 2005-11-24
  • 打赏
  • 举报
回复
检查一下SQL登录用户的权限。
hansonboy 2005-11-24
  • 打赏
  • 举报
回复
如果只是普通的更新就好办了, 我是要根据条件读出一些纪录,按顺序显示出来, 而且对其中符合条件的纪录进行更新,
原来在access数据库中
do while not rs.eof

if rs("lll")=".." then
rs("aaa")="..."
rs.update
end if
loop
但现在在SQL SERVER中不行,
只能把
rs("aaa")="..."
rs.update
改成
conn.execute("update ...")但不明白为什么不行
yopy 2005-11-24
  • 打赏
  • 举报
回复
adssqlp="update Advertisement_Ads where act=1 and class <> 0 and place=23 order by time"
你是要更新还是要做什么哦
要更新的话,你就写成下面的
hansonboy 2005-11-24
  • 打赏
  • 举报
回复
up

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧