asp+access怎么删除表中的记录?
<%
Set conn = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("pic.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
set rs=server.createobject("ADODB.recordset")
SQL="Select * From yun"
rs.open sql,conn,1,3
rs.delete
rs.update
rs.Close
Set rs=Nothing
conn.Close
Set conn=Nothing
%>
<html>
<center>
<body>
<a href="index1.htm">返回</a>
</body>
</center>
<html>
我要删除 数据pic.mdb中的yun表的记录,该表id字段主键,自动编号的。
答案:如果你是要简单地删除全部记录的话,就不需要用记录集RS了:
<%
Set conn = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("pic.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
SQL="delete * From yun"
conn.Execute sql
conn.Close
Set conn=Nothing
%>
<html>
<center>
<body>
<a href="index1.htm">返回</a>
</body>
</center>
<html>
上一个:ASP+Access 数据库 查询问题
下一个:asp中如何嵌入python