Pessoal agradeço a ajuda, deu certinho só que agora tem um outro problema, preciso buscar todas os resultados que contenham determinada palavra, mas isso em 2 campos dos 4 que tenho. Tipo: tenho número da empresa, numero do fabricante, descrição e aplicação. Quando eu mando buscar pelo num da empresa ou do fabricante tá beleza, mas quando eu mando buscar pela descrição ou pela aplicação, só me retorna 1 resultado e se a palavra for a primeira da frase. E só o primeiro resultado do bd. Se alguém souber mudar agradeço. Segue o ASP que tá funcionando, mas faltando uns detalhes
<%@LANGUAGE="VBSCRIPT" %>
<%
Option Explicit
Dim Filtro
Filtro = Cstr(Trim((Request.Form("Criterio"))))
Dim Palavra
Palavra = Request.Form("Palavra")
Dim BdWeb
Set BdWeb = Server.CreateObject("ADODB.Connection")
BdWeb.Open = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("Pesquisa.mdb")
Dim Sql
Select Case Filtro
Case "NumeroMedauto"
Sql = "SELECT * FROM Pesquisa WHERE NumeroMedauto LIKE '%" & Palavra & "%'"
Case "NumeroOriginal"
Sql = "SELECT * FROM Pesquisa WHERE NumeroOriginal LIKE '%" & Palavra & "%'"
Case "Descricao"
Sql = "SELECT * FROM Pesquisa WHERE Descricao LIKE '%" & Palavra & "%'"
Case "Aplicacao"
Sql = "SELECT * FROM Pesquisa WHERE Aplicacao LIKE '%" & Palavra & "%'"
End Select
Dim WebRs
Set WebRs = Server.CreateObject("ADODB.Recordset")
WebRs.Open Sql , BdWeb, 3
If WebRs.EOF Then%>
<style type="text/css">
<!--
#centro {
position:absolute;
top:50%;
left:50%;
width:770;
height:454;
margin-left:-385px;
margin-top:-225px;
margin-bottom:0px;
text-align:left;
.style1 {
font-family: Verdana;
font-weight: bold;
}
.style2 {
font-family: Verdana;
font-size: x-small;
font-weight: bold;
}
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
body {
background-image: url('images/fundo.jpg');
background-repeat: repeat
}
.style4 {font-family: Verdana; font-weight: bold; color: #FF0000; }
-->
</style>
<style type="text/css">
<!--
.style4 {font-family: Verdana}
.style6 {font-family: Verdana; font-size: x-small; }
-->
</style>
<body onLoad="dynAnimation()">
<div id="centro">
<table width="770" height="317" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="155" colspan="2" bgcolor="#E8E8E8"><img name="index_r1_c1" src="images/index_r1_c1.jpg" width="249" height="155" border="0" id="index_r1_c1" alt="" /></td>
<td colspan="2">
<table align="left" border="0" cellpadding="0" cellspacing="0" width="521">
<tr>
<td><img name="index_r1_c5" src="images/index_r1_c5.jpg" width="521" height="9" border="0" id="index_r1_c5" alt="" /></td>
</tr>
<tr>
<td>
<table align="left" border="0" cellpadding="0" cellspacing="0" width="521">
<td width="396"><img name="index_r2_c5" src="images/index_r2_c5.jpg" width="396" height="118" border="0" id="index_r2_c5" alt="" /></td>
<td width="125"><img name="index_r2_c9" src="images/index_r2_c9.jpg" width="125" height="118" border="0" id="index_r2_c9" alt="" /></td>
</tr>
</table>
</td></tr>
<tr>
<td height="19"><img name="index_r3_c5" src="images/index_r3_c5.jpg" width="521" height="28" border="0" id="index_r3_c5" alt="" /></td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#E8E8E8">
<td height="10" colspan="4"><img name="index_r4_c1" src="images/index_r4_c1.jpg" width="770" height="10" border="0" id="index_r4_c1" alt="" /></td>
</tr>
<tr bgcolor="#E8E8E8">
<td height="10" colspan="4"><img name="index_r6_c1" src="images/index_r6_c1.jpg" width="770" height="10" border="0" id="index_r6_c1" alt="" /></td>
</tr>
<tr>
<td width="7" bgcolor="#E8E8E8"><img name="index_r7_c1" src="images/index_r7_c1.jpg" width="6" height="40" border="0" id="index_r7_c1" alt="" /></td>
<td width="242" height="40" background="images/index_r7_c2.jpg">
<table width="203" border="0">
<tr>
<td height="27" valign="bottom">
<div align="right"><span class="style4">Busca de Produtos </span></div>
</td>
</tr>
</table>
</td>
<td colspan="2"><img name="index_r7_c5" src="images/index_r7_c5.jpg" width="521" height="40" border="0" id="index_r7_c5" alt="" /></td>
</tr>
<tr bgcolor="#E8E8E8">
<td height="11" colspan="4"><img name="index_r8_c1" src="images/index_r8_c1.jpg" width="770" height="11" border="0" id="index_r8_c1" alt="" /></td>
</tr>
<td height="72" colspan="2" background="images/fundo_a.jpg"> </td>
<td width="521" background="images/fundo_c.jpg">
<center>
Nenhuma informação localizada !<br>
<br>
<a href="busca.htm"><b>Retorna</b></a><b>
<%Else%>
</b>
</center>
</td>
<tr>
<td height="19" colspan="3"> </td>
</table>
<p> </p>
<style type="text/css">
<!--
#centro {
position:absolute;
top:50%;
left:50%;
width:770;
height:454;
margin-left:-385px;
margin-top:-225px;
margin-bottom:0px;
text-align:left;
.style1 {
font-family: Verdana;
font-size: small;
font-weight: bold;
}
-->
</style>
<style type="text/css">
<!--
.style1 {
font-family: Verdana;
font-weight: bold;
}
.style2 {
font-family: Verdana;
font-size: x-small;
font-weight: bold;
}
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
body {
background-image: url('images/fundo.jpg');
background-repeat: repeat
}
.style4 {font-family: Verdana; font-weight: bold; color: #FF0000; }
-->
</style>
<style type="text/css">
<!--
.style4 {font-family: Verdana}
.style6 {font-family: Verdana; font-size: x-small; }
-->
</style>
<body onLoad="dynAnimation()">
<div id="centro">
<table width="769" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#E8E8E8">
<tr>
<td height="155" colspan="2" bgcolor="#E8E8E8"><img name="index_r1_c1" src="images/index_r1_c1.jpg" width="249" height="155" border="0" id="index_r1_c1" alt="" /></td>
<td colspan="3"><table align="left" border="0" cellpadding="0" cellspacing="0" width="521">
<tr>
<td><img name="index_r1_c5" src="images/index_r1_c5.jpg" width="521" height="9" border="0" id="index_r1_c5" alt="" /></td>
</tr>
<tr>
<td>
<table align="left" border="0" cellpadding="0" cellspacing="0" width="521">
<td width="396"><img name="index_r2_c5" src="images/index_r2_c5.jpg" width="396" height="118" border="0" id="index_r2_c5" alt="" /></td>
<td width="125"><img name="index_r2_c9" src="images/index_r2_c9.jpg" width="125" height="118" border="0" id="index_r2_c9" alt="" /></td>
</tr>
</table></td></tr>
<tr>
<td height="19"><img name="index_r3_c5" src="images/index_r3_c5.jpg" width="521" height="28" border="0" id="index_r3_c5" alt="" /></td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#E8E8E8">
<td height="10" colspan="5"><img name="index_r4_c1" src="images/index_r4_c1.jpg" width="770" height="10" border="0" id="index_r4_c1" alt="" /></td>
</tr>
<tr bgcolor="#E8E8E8">
<td height="21" colspan="5">
<table align="left" border="0" cellpadding="0" cellspacing="0" width="770">
<tr>
<td><img name="index_r5_c1" src="images/index_r5_c1.jpg" width="6" height="21" border="0" id="index_r5_c1" alt="" /></td>
<td> <a onMouseOver="document['fpAnimswapImgFP1'].imgRolln=document['fpAnimswapImgFP1'].src;document['fpAnimswapImgFP1'].src=document['fpAnimswapImgFP1'].lowsrc;" onMouseOut="document['fpAnimswapImgFP1'].src=document['fpAnimswapImgFP1'].imgRolln" href="index.htm"> <img name="fpAnimswapImgFP1" src="images/index_r5_c2.jpg" width="63" height="21" border="0" id="fpAnimswapImgFP1" alt="" dynamicanimation="fpAnimswapImgFP1" lowsrc="images/bt_color_r1_c1.jpg" /></a></td>
<td> <a onMouseOver="document['fpAnimswapImgFP2'].imgRolln=document['fpAnimswapImgFP2'].src;document['fpAnimswapImgFP2'].src=document['fpAnimswapImgFP2'].lowsrc;" onMouseOut="document['fpAnimswapImgFP2'].src=document['fpAnimswapImgFP2'].imgRolln" href="quem.htm"> <img name="fpAnimswapImgFP2" src="images/index_r5_c3.jpg" width="110" height="21" border="0" id="fpAnimswapImgFP2" alt="" dynamicanimation="fpAnimswapImgFP2" lowsrc="images/bt_color_r1_c2.jpg" /></a></td>
<td> <a onMouseOver="document['fpAnimswapImgFP3'].imgRolln=document['fpAnimswapImgFP3'].src;document['fpAnimswapImgFP3'].src=document['fpAnimswapImgFP3'].lowsrc;" onMouseOut="document['fpAnimswapImgFP3'].src=document['fpAnimswapImgFP3'].imgRolln" href="busca.htm"> <img name="fpAnimswapImgFP3" src="images/bt_color_r1_c3.jpg" width="150" height="21" border="0" id="fpAnimswapImgFP3" alt="" dynamicanimation="fpAnimswapImgFP3" lowsrc="images/bt_color_r1_c3.jpg" /></a></td>
<td> <a onMouseOver="document['fpAnimswapImgFP4'].imgRolln=document['fpAnimswapImgFP4'].src;document['fpAnimswapImgFP4'].src=document['fpAnimswapImgFP4'].lowsrc;" onMouseOut="document['fpAnimswapImgFP4'].src=document['fpAnimswapImgFP4'].imgRolln" href="repr.htm"> <img name="fpAnimswapImgFP4" src="images/index_r5_c6.jpg" width="133" height="21" border="0" id="fpAnimswapImgFP4" alt="" dynamicanimation="fpAnimswapImgFP4" lowsrc="images/bt_color_r1_c5.jpg" /></a></td>
<td> <a onMouseOver="document['fpAnimswapImgFP5'].imgRolln=document['fpAnimswapImgFP5'].src;document['fpAnimswapImgFP5'].src=document['fpAnimswapImgFP5'].lowsrc;" onMouseOut="document['fpAnimswapImgFP5'].src=document['fpAnimswapImgFP5'].imgRolln" href="cat.htm"> <img name="fpAnimswapImgFP5" src="images/index_r5_c7.jpg" width="132" height="21" border="0" id="fpAnimswapImgFP5" alt="" dynamicanimation="fpAnimswapImgFP5" lowsrc="images/bt_color_r1_c6.jpg" /></a></td>
<td> <a onMouseOver="document['fpAnimswapImgFP6'].imgRolln=document['fpAnimswapImgFP6'].src;document['fpAnimswapImgFP6'].src=document['fpAnimswapImgFP6'].lowsrc;" onMouseOut="document['fpAnimswapImgFP6'].src=document['fpAnimswapImgFP6'].imgRolln" href="parc.htm"> <img name="fpAnimswapImgFP6" src="images/index_r5_c8.jpg" width="91" height="21" border="0" id="fpAnimswapImgFP6" alt="" dynamicanimation="fpAnimswapImgFP6" lowsrc="images/bt_color_r1_c7.jpg" /></a></td>
<td> <a onMouseOver="document['fpAnimswapImgFP7'].imgRolln=document['fpAnimswapImgFP7'].src;document['fpAnimswapImgFP7'].src=document['fpAnimswapImgFP7'].lowsrc;" onMouseOut="document['fpAnimswapImgFP7'].src=document['fpAnimswapImgFP7'].imgRolln" href="contato.htm"> <img name="fpAnimswapImgFP7" src="images/index_r5_c10.jpg" width="80" height="21" border="0" id="fpAnimswapImgFP7" alt="" dynamicanimation="fpAnimswapImgFP7" lowsrc="images/bt_color_r1_c9.jpg" /></a></td>
<td><img name="index_r5_c12" src="images/index_r5_c12.jpg" width="5" height="21" border="0" id="index_r5_c12" alt="" /></td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#E8E8E8">
<td height="10" colspan="5"><img name="index_r6_c1" src="images/index_r6_c1.jpg" width="770" height="10" border="0" id="index_r6_c1" alt="" /></td>
</tr>
<tr>
<td width="6" bgcolor="#E8E8E8"><img name="index_r7_c1" src="images/index_r7_c1.jpg" width="6" height="40" border="0" id="index_r7_c1" alt="" /></td>
<td width="243" height="40" background="images/index_r7_c2.jpg">
<table width="203" border="0">
<tr>
<td height="27" valign="bottom">
<div align="right"><span class="style4">Busca de Produtos </span></div>
</td>
</tr>
</table>
</td>
<td colspan="3"><img name="index_r7_c5" src="images/index_r7_c5.jpg" width="521" height="40" border="0" id="index_r7_c5" alt="" /></td>
</tr>
<tr bgcolor="#E8E8E8">
<td height="11" colspan="5"><img name="index_r8_c1" src="images/index_r8_c1.jpg" width="770" height="11" border="0" id="index_r8_c1" alt="" /></td>
</tr>
<tr bgcolor="#E8E8E8">
<td width="6" height="146" background="images/index_r9_c1.jpg" bgcolor="#E8E8E8"> </td>
<td background="images/fundo_b.jpg">
<center>
<span class="style1">Resultado da Busca:</span>
</center>
</td>
<td width="510" background="images/fundo_b.jpg">
<h2>
<table width="95%" height="104" border="1" align="center">
<tr>
<td width="42%" rowspan="4">
<div align="center"><img border="no" src="<%=WebRs("Imagem")%>">
</div>
</td>
<td width="58%" height="24"><span class="style6"><b>Número Medauto: </b><%=WebRs("NumeroMedauto")%></span></td>
</tr>
<tr>
<td><span class="style6"><b>Número Original: </b><%=WebRs("NumeroOriginal")%></span></td>
</tr>
<tr>
<td><span class="style6"><b>Descrição: </b><%=WebRs("Descricao")%></span></td>
</tr>
<tr>
<td><span class="style6"><b>Aplicação: </b><%=WebRs("Aplicacao")%></span></td>
</tr>
</table>
<br />
</h2>
<center>
<table width="200" border="0" align="center">
<tr>
<td>
<center>
<a href="busca.htm" class="style2">Retorna</a>
</center>
</td>
</tr>
</table>
</center>
<td width="11" background="images/index_r9_c11.jpg">
<tr>
<%
Do While Not WebRs.EOF
%>
<%WebRs.MoveNext
Loop%>
<tr>
<p>
<%
WebRs.Close
Set WebRs = Nothing
BdWeb.Close
Set BdWeb = Nothing
End If
%>
<tr bgcolor="#E8E8E8">
<td height="18" colspan="5"><img name="index_r10_c1" src="images/index_r10_c1.jpg" width="770" height="18" border="0" id="index_r10_c1" alt="" /></td>
</tr>
<tr bgcolor="#E8E8E8">
<td height="17" colspan="5"><img name="index_r11_c1" src="images/index_r11_c1.jpg" width="770" height="17" border="0" id="index_r11_c1" alt="" /></td>
</tr>
</table></div>