数据库记录为啥无法删除?

nicepp 2005-06-06 11:44:25
从网上找了一段各位大牛提供的删除文件和记录代码,我的代码如下:
strP="select * from up_Images where i_ID="&cstr(id)

Set rsP=server.createobject("adodb.recordset")
rsP.open strP,conn,3
upfile=rsP("i_Url")
set fso=server.CreateObject("scripting.filesystemobject")
fso.deletefile(server.MapPath(upfile))
set fso=nothing

rsP.delete
rsP.update
rsP.close
set rsP=nothing
现在显示删除文件可以,但是无法删除数据库中记录:
出错信息提示如下:
ADODB.Recordset error '800a0cb3'

Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.

/manage/Editpicture.asp, line 59

请各位帮我看看,以上我的代码错在那里,谢谢!

...全文
89 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
nicepp 2005-06-06
  • 打赏
  • 举报
回复
谢谢各位,我老眼昏花了,是应该rsP.open strP,conn,3,3
或者rsP.open strP,conn,1,3,怎么会少写一个呢?


rs.update去不去掉都没关系。

马上结贴补:)
jzywh 2005-06-06
  • 打赏
  • 举报
回复
'rs.update多余,去掉


同意
whao 2005-06-06
  • 打赏
  • 举报
回复
'rs.update多余,去掉

strP="select * from up_Images where i_ID="&cstr(id)

Set rsP=server.createobject("adodb.recordset")
rsP.open strP,conn,3
upfile=rsP("i_Url")
set fso=server.CreateObject("scripting.filesystemobject")
fso.deletefile(server.MapPath(upfile))
set fso=nothing

rsP.delete

rsP.close
set rsP=nothing
若白师妹 2005-06-06
  • 打赏
  • 举报
回复
strP="select * from up_Images where i_ID="&cstr(id)

Set rsP=server.createobject("adodb.recordset")
rsP.open strP,conn,1,3
upfile=rsP("i_Url")
set fso=server.CreateObject("scripting.filesystemobject")
fso.deletefile(server.MapPath(upfile))
set fso=nothing

rsP.delete

rsP.close
set rsP=nothing
孟子E章 2005-06-06
  • 打赏
  • 举报
回复
rsP.open strP,conn,3,3

28,406

社区成员

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

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