这段查找代码什么地方有问题

来源:百度知道 编辑:UC知道 时间:2024/05/16 13:07:12
<%
choose = request.Form("choose")
strtitle = request.Form("title")
if(isempty(choose)) then
choose="title"
end if
Set rs2 = Server.CreateObject ("ADODB.Recordset")
rs2.open "select * from affiche where "&choose&" like '%"&(strtitle)&"%'",conn,1,1
if rs2.eof and rs2.bof and not isempty(strtitle)then

response.Write("<font color='red'>没有相关数据!请确认后,重新查询!!</font>")
end if
if not rs2.eof then
response.Write "<table border=1><tr><td><b>id<b></td><td><b>title<b></td><td><b>time<b></td><td><b>issuer<b></td><td><b>content<b></td></tr>"
do while not rs2.eof
response.Write "<tr><td>" & rs2("id") & "</

说下预期结果和实际结果

应该提前判断变量strtitle是否合法了

例如:
if strtitle="" then response.Write("<font color='red'>请输入完整!!</font>")
Response.end()