如何使用DELETE方法?

ZSAJIE 2003-12-12 06:26:27
如何使用RECORDSET方法中的DELETE方法,请给我一个从打开数据库到删除操作完成的代码。
如果要求删除编号为11,13,67等不连续的记录
是用sql方法执行好还是用RECORDSET中的DELETE方法好呢?
请大家帮忙参考一下谢谢!
...全文
119 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
ZSAJIE 2003-12-12
  • 打赏
  • 举报
回复
楼上句子正确吗?怎么理解?
mofan4862 2003-12-12
  • 打赏
  • 举报
回复
将传过来的值
tring="'"+N1+","+N2…+"'"
sql="select * from news where id in"&tring
angelheavens 2003-12-12
  • 打赏
  • 举报
回复
是经常用来UPDATE,DELETE,INSERT
angelheavens 2003-12-12
  • 打赏
  • 举报
回复
是的
ZSAJIE 2003-12-12
  • 打赏
  • 举报
回复
当表单提交以后,这样可以吗?
for each boxnews in request.form("boxnews")
sql="select * from news where id=" & cint(boxnews)
conn.execute(sql)
next

这样的语句算是普遍的吗?
angelheavens 2003-12-12
  • 打赏
  • 举报
回复
sql="delete from table where id=11;delete from table where id=13;delete from table where id=67"
conn.execute(sql)
a_zhe_20 2003-12-12
  • 打赏
  • 举报
回复
打开数据库的代码就自己去找吧
删除用直接用conn.execute比较好,直观方便
用recordset的delete方法(还没用过),还要考虑到纪录集的游标打开方式等。

删除编号有无来源(即提交信息)?
没有的话只有一个一个来了
sql="delete from table where id=11"
sql="delete from table where id=13"
sql="delete from table where id=67"

28,391

社区成员

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

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