ASP ACCESS删除数据的简单问题

来源:百度知道 编辑:UC知道 时间:2024/05/16 12:08:27
是转向本页内删除功能.
大致如下
tongxunlu.asp?action=del&id=<%=rs("id")%>
上句是 删除俩字的连接

下边则是删除过程
数据库没连错.
做出后点删除效果后,提示删除成功.但是就是删除不掉表里的东西,求救
<%if request("action")="del" then
exec="delete from tongxunlu where id=" & CLng(ID)
response.write"<script>alert('删除成功');location.href='tongxunlu.asp';</script>"
response.end
Conn.Execute exec
response.redirect"tongxunlu.asp"
end if
%>

<%if request("action")="del" then
ID = Request("ID")
------------------------
Alertconn是打开数据库的所以不能少,这里的是根据你数据库连接中所用的参数
Alertconn.execute="delete from tongxunlu where id=" & CLng(ID)
____________________
数据库连接如下
Alertconnstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(Alertdbpath)
Set Alertconn = Server.CreateObject("ADODB.Connection")
Alertconn.Open Alertconnstr
--------------------------------

response.write"<script>alert('删除成功');location.href='tongxunlu.asp';</script>"
response.end
Conn.Execute exec
response.redirect"tongxunlu.asp"
end if
%>

<%if request("action")="del" then
exec="delete from tongxunlu where id=" & CLng(ID)
response.write"<script>alert('删除成功');location.href='tongxun