您的位置首页百科问答

电脑的搜索程序是怎么编的?

电脑的搜索程序是怎么编的?

的有关信息介绍如下:

电脑的搜索程序是怎么编的?

搜索的ASP的源代码如下

<唤粗font size="2">库存搜索
下边是执行搜索的代码:<% session("search")=request.form("search") if trim(session("search"))="" then %> <% end if dim rs,strsql set rs=server.CreateObject("adodb.recordset") if request("sousuo")="pbh" then strsql="select * from ctian1 where pbh like '%"& trim(session("search"))&"%'" else if request("sousuo")="pmc" then strsql="select * from ctian1 where pmc like '%"& trim(request("search"))&"%'" else if request("sousuo")="pxh" then strsql="select * from ctian1 where pxh like '%"& trim(request("search"))&"%'" else if request("sousuo")="ppp" then strsql="select * from ctian1 where ppp like '%"& trim(request("search"))&"%'" else if request("sousuo")="pcd" then strsql="select * from ctian1 where pcd like '%"& trim(request("search"))&"%'" else if request("sousuo")="plb" then strsql="select * from ctian1 where plb like '%"& trim(request("search"))&"%'" else if request("sousuo")="psl" then strsql="select * from ctian1 where psl = '"& trim(request("search"))&"'" else if request("sousuo")="pdw"和世镇 then strsql="select * from ctian1 where pdw like '%"& trim(request("search"))&"%'" else if request("sousuo")="prq" then strsql="select * from ctian1 where prq like '%"& trim(request("search"))&"%'" else if request("sousuo")="pbz" then strsql="select * from ctian1 where pbz like '%"& trim(request("search"))&"%'" Else If request("sousuo")="" Then end if end if end if end if end if end if End if end if end if end if end if rs.open strsql,db,1if rs.recordcount<=0 then %> <% else response.write"查询结果: 共找到"& rs.recordcount & "个结果" end if %> 下边写显示具体数据的代码就可以了.