conn.execute"delete from upfile where FilePath in('"&FilePath&"')"删不了多条记录

weixin_43671945 2019-01-10 11:27:13

FilePath是复选框的选集

conn.execute"delete from upfile where FilePath in('"&FilePath&"')" 这个复选框的值是FilePath
如果是选一个的话,可以删成功,选两个以上就删不了了。怪事。

但是如果换回ID,又可以删所选两条以上的记录:
conn.execute"delete from upfile where id in("&id&")" 这个复选框的值是id


upfile数据库记录大概是这样:
id FilePath
1 b5.jpg
2 a1.jpg
3 b2 .jpg
...全文
9826 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
qr.update(sql),不要带其他参数
csdn_aspnet 2019-01-18
  • 打赏
  • 举报
回复
conn.execute"delete from upfile where FilePath in('"&FilePath&"')" 这个FilePath 你要自己做好拼接处理 做好后应该是这样: conn.execute"delete from upfile where FilePath in('FilePath1','FilePath2','FilePath3')"
weixin_43671945 2019-01-17
  • 打赏
  • 举报
回复
里面是变量,而且是个集,怎么能每个加个''
weixin_43671945 2019-01-17
  • 打赏
  • 举报
回复
引用 2 楼 紫魂一号 的回复:
id是数字,可以不用单引号,图片是字符串单引号+逗号拼接起来。。

是这样的。具体是怎么写
hookee 2019-01-17
  • 打赏
  • 举报
回复
delete from upfile where FilePath in ('b5.jpg', 'a1.jpg', 'b2.jpg' ) 另外拼接sql语句存在sql注入漏洞。
紫魂一号 2019-01-16
  • 打赏
  • 举报
回复
id是数字,可以不用单引号,图片是字符串单引号+逗号拼接起来。。
  • 打赏
  • 举报
回复
1.输出FilePath值,
2.FilePath in("&FilePath&")试下
3.具体报错信息有没有?

28,409

社区成员

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

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