📄 delete.asp
字号:
<%Response.Buffer=True%>
<!--#Include file="odbc_connection.asp"-->
<html>
<head>
<title>删除客户记录</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css">
<!--
body,td,th {
font-size: 14px;
}
body {
background-color: #FFFDEE;
}
-->
</style>
</head>
<body>
<% If session("id")="" Then
Response.Redirect "index.asp"
end if
%>
<h2 align="center">删除客户记录</h2>
<center>
<form method="post" action="">
<table border="0" width="90%" bgcolor="#CC9933">
<tr>
<td>姓名:</td><td><input type="text" name="name" size="20" ></td>
</tr><tr>
<tr>
<td>身份证:</td><td><input type="sfz" name="sfz" size="20"></td>
</tr><tr>
<td></td><td><input type="submit" value=" 确 定 "></td>
</tr>
<table>
</form>
</center>
<%
'如果没有输入客户名和身份证号,就不执行下列语句
If Trim(Request("name"))<>"" And Trim(Request("sfz"))<>"" Then
'执行删除操作,删除匹配的记录
Dim strSql
strSql ="Delete From users Where name='" & Request("name") & "' And sfz='" & Request("sfz") & "'"
'这里利用Execute方法的一个参数,用number返回该操作影响的记录数。
Dim number
db.Execute strSql,number
If number=0 Then
Response.Write "客户名跟身份证不符合,找不到记录"
Else
Response.Write "<p align='center'>共有" & number & "条数据被删除"
End If
End If
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -