http://www.chuangdian.net/Product.asp。。各位这个作品搜索不正常。问题出在那里呢?
复制内容到剪贴板
代码:
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
sqlSearch="select top " & MaxPerPage
else
sqlSearch="select "
end if
sqlSearch=sqlSearch & " * from Product01 where Passed=True "
if BigClassName<>"" then
sqlSearch=sqlSearch & " and BigClassName="&BigClassName&" "
end if
if keyword<>"" then
select case strField
case "Title"
sqlSearch=sqlSearch & " and Title like '%" & keyword & "%' "
case "Content"
sqlSearch=sqlSearch & " and Content like '%" & keyword & "%' "
case else
sqlSearch=sqlSearch & " and Title like '%" & keyword & "%' "
end select
end if
sqlSearch=sqlSearch & " order by ID desc"
Set rsSearch= Server.CreateObject("ADODB.Recordset")
rsSearch.open sqlSearch,conn,1,1 复制内容到剪贴板
代码:
<form method="Get" name="myform" action="search.asp">
<tr>
<td height="28"> <select name="Field" size="1">
<option value="Title" selected>产品名称</option>
<option value="Content">产品说明</option>
</select>
<%if ShowType=1 then%>
</td>
<td height="28">
<%end if%>
<select name="BigClassName" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">
<option selected value="">所有大类</option>
<%
if not (rsBigClass.bof and rsBigClass.eof) then
rsBigClass.movefirst
do while not rsBigClass.eof
response.Write "<option value="&trim(rsBigClass("BigClassName"))&">" & trim(rsBigClass("BigClassName")) & "</option>"
rsBigClass.movenext
loop
end if
%>
</select>
<%if ShowType=1 then%>
</td>
<td height="28">
<%end if%>
<%if ShowType=1 then%>
</td>
<td height="28">
<%end if%>
<input type="text" name="keyword" size=12 value="关键字" maxlength="50" onFocus="this.select();">
<input type="submit" name="Submit" value="搜索"> </td>
</tr>
</form>这是南方数据里面的程序。。。其中BigClassName的数据类型为数字型
[
本帖最后由 zhuerhongyan 于 2008-8-11 18:20 编辑 ]