最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp批量删除数据的几种方法
时间:2010-10-01 编辑:简简单单 来源:一聚教程网
批量删除数据方法一
id=request.form("checkbox")
id=split(id,",")
shu=0
for i=0 to ubound(id)
sql="select * from jiang_fname where id="&id(i)
set rs=conn.execute(sql)
if not rs.eof then
delete_file(rs("fname"))
end if
rs.close
set rs=nothing
sql="delete from jiang_fname where id="&id(i)
conn.execute sql,shu1
shu=shu+1
nextif shu>0 then
response.write("")
else
response.write("")
end if
conn.close
set conn=nothing
方法二 使用了sql in
<%
arrdel=request("id")
'response.write arrdel
sql="delete from news where id in ("&arrdel&")"
'response.write sql
conn.execute sql
set conn=nothing
response.write""
response.end
%>
上面的二个批量删除实例代码,利用in的效益更高,也简单一些,用遍历的感觉代码多了一些。
-
上一个: asp用户注册实例程序
-
下一个: asp 保存数据与批量删除数据方法
相关文章
- asp 同时删除2个表里的数据 04-14
- VBS 批量Ping的项目讲解 09-19
- 如何封装一个Ajax函数介绍 09-16
- ASP实现加法验证码方法 09-16
- ASP错误捕获的几种常规处理方法介绍 09-16
- ajax实现城市三级联动的代码介绍 09-16