哪位帮我修改下asp查询后删除信息

来源:百度知道 编辑:UC知道 时间:2024/06/28 04:46:12
<HTML>
<HEAD>
<TITLE> 查找记录 </TITLE>
</HEAD>
<body>
<h2 align="center">学生信息查找界面</h2>

<form name="frmUpdate" method="POST" action="" >
请输入要查找的学号<INPUT size=15 name=studentno>
<INPUT type=submit value=确定 name=btnSubmit></a>
<%
if request.form("studentno")<>""then
'以下连接数据库,建立一个Connection对象实例conn
Dim conn,strConn
Set conn=Server.CreateObject("ADODB.Connection")
strConn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("main.mdb")
conn.Open strConn
'以下建立记录集,建立一个RecordSet对象实例rs
dim rs,strsql
strSql="Select * From student Where studentno Like '%" & Request.Form("studentno") & "%'"
set rs=conn.execute(strsql)
%>
<table b

delete.asp页面出错了
strSql="Delete From student Where studentno=" & Request.QueryString("studentno")
应改为
strSql="Delete From student Where studentno like '%" & Request.QueryString("studentno")&"%'"

studentno这个如果是字符串的数据类型需要
strSql="Delete From student Where studentno='" & Request.QueryString("studentno")&"'"