#2
sncelpl2022-03-01 09:52
|
<%
str=NoCSSHack(left(FormatHTML(Server.HTMLEnCode(request("q"))),50))
if str="" then
response.write "请输入关键词。"
else
for i=1 to len(str)
if i<>len(str) then
sql=sql&"题目内容 not like '%"&str&"%' and 题目内容 like '%"&mid(str,i,2)&"%' or "
else
sql=sql&"答案 like '%"&str&"%' and 题目内容 not like '%"&str&"%'"
end if
next
set rs=server.createobject("adodb.recordset")
sql="select *,1 from [Sheet1$] where 题目内容 like '%"&str&"%'or 题型 like '%"&str&"%'"
rs.open sql,conn,1,1
if rs.eof then
Response.Write "没有搜索到内容。"
else
do while not rs.eof
Response.Write "[ "
response.write "<font color=red>" & rs("题型") & "</font>"
Response.Write " ] [ "
Response.Write "答案 "
response.write "<font color=red>" & rs("答案") & "</font>"
Response.Write " ] "
Response.Write rs("题目内容")
Response.Write rs("选项A")
Response.Write rs("选项B")
Response.Write rs("选项C")
Response.Write rs("选项D")
Response.Write rs("选项E")
'Response.Write " "
Response.Write "<br>"
rs.movenext
loop
end if
rs.close
end if
%>
怎么在查询结果前生成编号如:查询"中国"
1、中国...
2、...中国..
3、中国