初学,哥哥姐姐帮忙啊!

wwwjia 2004-04-03 09:37:39

<%newsid=request("id")
set rs_del=cn.execute("select pic from honor where id="&newsid)
if not isnull(rs_del("pic")) then
if not rs_del.eof then
set fso=server.createobject("scripting.filesystemobject")

fname=rs_del("pic")

end if
if fso.fileexists(server.mappath("/")&"\management\honor\upfile\"&fname) then
fso.deletefile(server.mappath("/")&"\management\honor\upfile\"&fname)
end if
end if
ADODB.Field 错误 '800a0bcd'

BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。

/gsdj/english/management/techn/modifysave.asp,行55
...全文
49 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wwwjia 2004-04-03
  • 打赏
  • 举报
回复
谢谢大家了,以后还要多帮忙啊!!
cjf1009 2004-04-03
  • 打赏
  • 举报
回复
应该先判断记录集是否为空,在判断其中字段的值是否为空,你弄反了。
hhzh426 2004-04-03
  • 打赏
  • 举报
回复
if not isnull(rs_del("pic")) then
if not rs_del.eof then

==>
if not rs_del.eof then
if not isnull(rs_del("pic")) then
试试
cjf1009 2004-04-03
  • 打赏
  • 举报
回复
<%newsid=request("id")
set rs_del=cn.execute("select pic from honor where id="&newsid)
if not rs_del.eof then
if not isnull(rs_del("pic")) then //调换顺序
set fso=server.createobject("scripting.filesystemobject")

fname=rs_del("pic")

end if
if fso.fileexists(server.mappath("/")&"\management\honor\upfile\"&fname) then
fso.deletefile(server.mappath("/")&"\management\honor\upfile\"&fname)
end if
end if
stefli 2004-04-03
  • 打赏
  • 举报
回复
if not isnull(rs_del("pic")) then
if not rs_del.eof then

->

if not rs_del.eof then '先判断是否为空
if not isnull(rs_del("pic")) then

28,409

社区成员

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

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