asp教程 刪除數據庫教程記錄入門教程
<script>
function check()
{
if(confirm('確認刪除',''))
{
//操作
}
}
</script>
<table width="312" border="0">
<tr>
<td width="220">a</td>
<td width="82">b</td>
</tr>
<tr>
<td>www.3lian.net </td>
<td><a href="?id=5" onClick="check();">刪除</a></td>
</tr>
</table>
<?
//asp 刪除數據庫記錄入門教程
SiteDb ="Database/mdb.mdb"
Set Conn = Server.CreateObject("Adodb.Connection")
ConnStr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(SiteDB)
Conn.Open ConnStr
Set Rs=Server.Createobject("Adodb.RecordSet")
Dim sql
sql ="delete from test where id="&request.query("id")
if rs.execute( sql ) then
response.write("刪除成功")
else
response.write("刪除失敗")
end if