id = 1
sql = "delete from data where id="&cint(id)
conn.execute(sql)
conn.close
set conn = nothing
说明:建立数据库连接;获取记录id;使用 delete 语句删除记录;conn.execute 来执行;最后关闭。
删除多条记录为:sql = "delete from data where id in (id1,id2,id3)"
删除所有记录为:sql = "delete from data"
1234下一页阅读全文