| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 520 人关注过本帖
标题:不能同时删除两个或以上,提示错误,各位大侠有请~
只看楼主 加入收藏
天蝎风
Rank: 1
来 自:广西
等 级:新手上路
帖 子:64
专家分:5
注 册:2010-11-7
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:4 
不能同时删除两个或以上,提示错误,各位大侠有请~
仓库管理界面:
图片附件: 游客没有浏览图片的权限,请 登录注册


同时选择两项或以上,点击删除后就出现以下错误:
==================================================
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14'
[Microsoft][ODBC Microsoft Access Driver] 语法错误 (逗号) 在查询表达式 'id_ku=15, 14' 中。
/3/system/ku_del.asp,行 10

======================================================
代码如下:
程序代码:
<%if session("redboy_username")="" then%>
<script language="javascript">top.location.href="../index.asp"</script>
<% 
  response.end
end if
%>
<!-- #include file="../conn2.asp" -->
<%
sql="select * from produit where id_ku="&request("id")&""
set rs=conn.execute(sql)
if rs.eof=false then
%>
  <script language="javascript">
    alert("此仓库中还存有产品,不能删除!")
    window.history.go(-1)
  </script>
<%
  response.end
end if
id=replace(request("id")," ","")
id=split(id,",")
for i=0 to UBound(id)
  conn.execute("delete from produit where id_ku="&id(i))
  sql="delete from ku where id="&id(i)
  conn.execute(sql)
next
response.redirect "ku.asp"
%>


[ 本帖最后由 天蝎风 于 2010-12-15 10:45 编辑 ]
搜索更多相关主题的帖子: 删除 有请 提示 
2010-12-15 10:43
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:15 
conn.execute("delete from produit where id_ku in ("&id(i)&")")
多个要用in不能用=号
2010-12-15 11:03
天蝎风
Rank: 1
来 自:广西
等 级:新手上路
帖 子:64
专家分:5
注 册:2010-11-7
收藏
得分:0 
以下是引用yms123在2010-12-15 11:03:40的发言:

conn.execute("delete from produit where id_ku in ("&id(i)&")")
多个要用in不能用=号
大侠再帮我看一下:
程序代码:
<%if session("redboy_username")="" then%>
<script language="javascript">top.location.href="../index.asp"</script>
<% 
  response.end
end if
%>
<!-- #include file="../conn2.asp" -->
<%
sql="select * from produit where id_ku in ("&request("id")&")
set rs=conn.execute(sql)
if rs.eof=false then
%>
  <script language="javascript">
    alert("此仓库中还存有产品,不能删除!")
    window.history.go(-1)
  </script>
<%
  response.end
end if
id=replace(request("id")," ","")
id=split(id,",")
for i=0 to UBound(id)
  conn.execute("delete from produit where id_ku in ("&id(i)&")")
  sql="delete from ku where id in "&id(i)
  conn.execute(sql)
next
response.redirect "ku.asp"
%>
==================================Microsoft VBScript 编译器错误 错误 '800a0409'

未结束的字符串常量

/3/system/ku_del.asp,行 9

sql="select * from produit where id_ku in ("&request("id")&")
-------------------------------------------------------------^

南宁信息网http://www.
2010-12-15 11:45
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:5 
sql="select * from produit where id_ku in ("&request("id")&")"
2010-12-15 12:02
天蝎风
Rank: 1
来 自:广西
等 级:新手上路
帖 子:64
专家分:5
注 册:2010-11-7
收藏
得分:0 
以下是引用yms123在2010-12-15 12:02:00的发言:

sql="select * from produit where id_ku in ("&request("id")&")"
OK了!谢谢版主yms123思密达,赏分!

南宁信息网http://www.
2010-12-15 13:10
快速回复:不能同时删除两个或以上,提示错误,各位大侠有请~
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.031533 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved