asp 搜索业 类型不匹配

来源:百度知道 编辑:UC知道 时间:2024/09/24 16:39:06
index.asp
<td colspan="2" rowspan="2" valign="top"><form name="form2" method="get" action="tjcx.asp">
站内搜索
<label>
<input name="sousuo" type="text" id="sousuo" size="15">
</label>
<select name="select" id="select">
<option value="biaoti">标题</option>
<option value="zuozhe">作者</option>
</select>
<input type="submit" name="button2" id="button2" value="搜索">
</form></td>
</tr>

提交业是
<%
dim rs,sql,sousuo,biaoti,zuozhe
sousuo=request.QueryString("sousuo")
biaoti=request.QueryString("biaoti")
zuozhe=request.QueryString("zuozhe")

类型不批不配的错误提示一般出现在sql语句中的非字符串比较中。
不过,你这代码好像少了不少东西啊?

sql"select * from xinwen where fbr and (fbtt or zuozhe) leke '%"&sousuo&"%' and ('"&biaoti&"' and '"&zuozhe&"' order by id desc"

这代码你确定是这样的吗??

if request("select") = "biaoti" then
sql = "select * from xinwen where fbtt like '%"sousou"%'"
else
sql = "select * from xinwen where zhuozhe like '%"sousou"%'"
end if