关于搜索的问题,高手请进!
是个关于产品搜索的问题:假如我一个产品同时满足下面三个搜索条件:DC Power Supply/Specialty Power Supply/Telecommunications Power Supply
我再按照其中之一条件搜索却显示不了该产品,不知道问题出在哪儿了?以下是关于搜索页面的代码: <!--#include file= "top.asp " -->
<!--#include file = "conn.asp "-->
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=utf-8 " />
<title> Gold Power Co., Ltd.--Home page </title>
<link href= "all.css " rel= "stylesheet " type= "text/css ">
<style type= "text/css ">
.ge {
border-right-style:dashed;
border-left-style:dashed;
border-right-color: #ADDFE4;
border-left-color: #ADDFE4;
color: #000000;
border-right-width: 1px;
border-left-width: 1px;
}
</style>
</head> <body>
<table width= "778 " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td height= "30 " > Home >> products >> search </td>
</tr>
<tr>
<td width= "770 " align= "center " valign= "top " >
<table width= "100% " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td height= "30 " colspan= "2 " valign= "middle " bgcolor= "#DAE7E7 " class= "name "> Search: </td>
</tr>
</table>
<form name= "form0 " method= "get " action= "searchResult00.asp ">
<table width= "70% " border= "0 " cellpadding= "0 " cellspacing= "2 " class= "ge ">
<tr>
<td height= "210 " align= "center " background= "images/search-bg.jpg " style= "background-repeat:no-repeat; background-position:center ">
<table width= "400 " border= "0 " cellspacing= "2 " cellpadding= "0 " height= "138 ">
<tr>
<td colspan= "3 " align= "center " valign= "bottom "> Search by Product
Types </td>
</tr>
<tr>
<td height= "8 " colspan= "3 "> </td>
</tr>
<tr>
<td width= "40 "> </td>
<td width= "87 ">
<p align= "left "> Product Types </td>
<td width= "265 ">
<select name= "selApplication1 " >
<!-- <option value= "0 " selected> --The application areas-- </option> -->
<option value= "DC Power Supply "> DC Power Supply </option>
<option value= "DC Power System "> DC Power System </option>
<option value= "Specialty Power Supply "> Specialty Power Supply </option>
<option value= "Telecommunications Power Supply "> Telecommunications Power Supply </option>
</select> </td>
</tr>
<tr>
<td height= "8 " colspan= "3 "> </td>
</tr>
<!-- <tr>
<td> </td>
<td> Cotegory: </td>
<td> <select name= "Leibie " >
<option value= "0 " selected> --The detailed category-- </option>
</select> </td>
</tr> -->
<tr>
<td height= "8 " colspan= "3 "> </td>
</tr>
<tr>
<td> </td>
<td>
<p align= "left "> Output </td>
<td>
<select name= "selOutputRoad1 ">
<!-- <option value= "0 " selected> --The output type-- </option> -->
<option value= "1 " > 1 </option>
<option value= "2 " > 2 </option>
<option value= "3 " > 3 </option>
<option value= "4 " > 4 </option>
<option value= "5 " > 5 </option>
<option value= "6 " > 6 </option>
</select> </td>
</tr>
<tr>
<td height= "8 " colspan= "3 "> </td>
</tr>
<tr>
<td colspan= "3 " align= "center " height= "25 ">
<input type= "submit " name= "searchByApp " value= "Submit "> </td>
</tr>
</table>
</form> </td>
</tr>
<tr>
<td height= "210 " align= "center " background= "images/search-bg.jpg " style= "background-repeat:no-repeat; background-position:center ">
<form name= "form1 " method= "get " action= "searchResult1.asp ">
<table width= "400 " border= "0 " cellspacing= "2 " cellpadding= "0 " height= "138 ">
<tr>
<td colspan= "3 " align= "center " valign= "bottom "> Search by
Applications </td>
</tr>
<tr>
<td height= "8 " colspan= "3 "> </td>
</tr>
<tr>
<td width= "40 "> </td>
<td width= "87 "> Applications: </td>
<td width= "265 ">
<select name= "selApplication " >
<!-- <option value= "0 " selected> --The application areas-- </option> -->
<option value= "Telecommunications "> Telecom power </option>
<option value= "Communications "> Communications </option>
<option value= "Networking "> Networking </option>
<option value= "Military "> Military </option>
<option value= "Electric power system "> Electric power system </option>
<option value= "Industrial control "> Industrial control </option>
<option value= "Fire control "> Fire control </option>
<option value= "Banking "> Banking </option>
<option value= "Medical "> Medical </option>
<option value= "Others "> Others </option>
</select> </td>
</tr>
<tr>
<td height= "8 " colspan= "3 "> </td>
</tr>
<!-- <tr>
<td> </td>
<td> Cotegory: </td>
<td> <select name= "Leibie " >
<option value= "0 " selected> --The detailed category-- </option>
</select> </td>
</tr> -->
<tr>
<td height= "8 " colspan= "3 "> </td>
</tr>
<tr>
<td> </td>
<td> Output </td>
<td>
[解决办法]
sql =sql & " and Noop = " & string2
改成
sql =sql & " and Noop = ' " & string2 & " ' "
看看