求助,高手进来看看。。
有一段代码,是删除用的,本来没错的,但一删除的话,就把全部名字相同的都删了,有没有办法只让它删除选中的那个条信息呢?谢谢大家了!!<!--#include file="..\Data\Data_connect.asp"-->
<%
del_name=request("del_name")
response.Write(del_name)
set rsflag=server.createobject("adodb.recordset")
sqltext="select * from [User] where department='"&del_name&"'"
rsflag.open sqltext,conn,1,1
If rsflag.recordcount>0 Then
rsflag.close
conn.close
response.write "<script language=JavaScript>{window.alert('此部门在员工表中已被引用,不能删除,请首先删除相应员工!');window.history.go(-1);}</script>"
response.end
End IF
set rs=server.createobject("adodb.recordset")
sqltext="delete from [jiaoxuejiang] where name='"&del_name&"'"
rs.open sqltext,conn,3,3
set rs=nothing
response.redirect "jiaoxuejiang.asp"
%>