1,首先要明確刪除哪條記錄無非還就是SQL語句了,比如對應到特定的某ID上。
id = request.form("id")
sql = "Select * from cnarticle where cn_id="&id
Set rs = Server.CreateObject ("ADODB.Recordset")
rs.Open sql,conn,2,3
2,很簡單的一條語句:刪除rs.delete
3,最好能在修改之前征求確認刪除<script language="JavaScript">
<!--
function suredo(src,q)
{
var ret;
ret = confirm(q);
if(ret!=false)window.location=src;
}
//-->
</script>
<a href='javascript:suredo("del.asp?id=<%=id%>","確定刪除?")'>Delete</a>
最直接的一條語句
sql = "delete * from cnarticle where cn_id="&id
conn.Execute(sql)