• 0
Sign in to follow this  
ju_rezende

Problemas Na Busca

Question

Olá pessoal estou com um probleminha na busca, ele da o seguinte erro

Tipo de erro:

Microsoft JET Database Engine (0x80040E14)

Erro de sintaxe. na expressão de consulta 'del = 0 And Empresa like '%cadive%'select distinct Categoria from clientes where del=0'.

/tulio/site/!!_material/pesquisa.asp, line 55

Bem vou deixar meu codigo, não endendo o que está acontecendo....

Abraços galera.......

Meu codigo

<html>

<head>

<title>Comércio de Jacareí</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body background="../imagem/bg.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="779" border="0" align="center" cellpadding="0" cellspacing="0" id="setores">

  <tr>

    <td bgcolor="#FFFFFF">

<table id="setores" width="779" height="864" border="0" cellpadding="0" cellspacing="0">

  <tr>

    <td width="779" height="33"><!--#include file="topo01.html"--></td>

</tr>

<tr>

  <td width="779" height="81"><!--#include file="topo02.asp"--></td>

</tr>

<tr>

 

  <td width="779" height="86" background="../imagem/bg_topo3.gif" ><!--#include file="topo3.html"--> </td>

</tr>

<tr>

  <td width="779" height="14" bgcolor="#8DB5AF"></td>

</tr>

<tr>

  <td width="779" height="3" bgcolor="#FFFFFF"></td>

</tr>

<tr>

    <td width="779" height="625" Valign="top" align="center">

<table width="770" border="0" cellspacing="0" cellpadding="0">

              <tr>

                <td valign="top"><div align="center"> </div>

                  <table id="lojamostra"width="770" border="0" cellspacing="0" cellpadding="0">

        <tr>

                      <td height="33"><font size="2" face="Arial, Helvetica, sans-serif"><a href="default.asp">Home</a></font>

                        <font size="2" face="Arial, Helvetica, sans-serif"><a href="Endereco.asp">Voltar</a></font>

                        <div align="center">

                          <%dim sql

if request.form("bairro")<>"Bairro" then

sql=" And  Bairro = '" & request.form("Bairro") & "'"

elseif request.form ("Categoria")<> "Categoria" then

sql=" And Categoria = '" & request.form("Categoria") & "'" & sql

elseif request.form ("Empresa") <> "" then

sql=" And Empresa like '%" & trim(request.form("Empresa")) & "%'" & sql

else

response.write "Nehum registro encontrado"

response.end

end if%>

                          <%set rs2 = server.CreateObject ("adodb.recordset")

rs2.Open "select * from clientes where del = 0 " & sql & " order by empresa",con,3,3 %>

                          <%Dim Bairro%>

                          <% Dim categoria%>

                          <%Dim Empresa %>

                          <% Bairro=request.form("Bairro")%>

                          <% Categoria=request.form("Categoria")%>

                          <%Empresa=request.form("Empresa")

%>

                        </div>

                  </td>

          <td width="340"><div align="right"><font size="2" face="Arial, Helvetica, sans-serif"><strong>Total

                          de registros</strong></font> <%=rs2.recordcount%> </div></td>

        </tr>

        <tr>

          <td colspan="2" align="center">

    <%if rs2.eof=true then %>

    <font color="#000000" size="2" face="Arial, Helvetica, sans-serif"><strong> <%response.write " Nenhum registro encontrado"%></strong></font></td>

        </tr>

  <%else%>

                    <tr >

                      <td colspan="2"background="../imagem/fundodaTd.gif"><font color="</td>#990000" size="2" face="Arial, Helvetica, sans-serif"><strong><font color="#990000" size="2" face="Arial, Helvetica, sans-serif">Pesquisa

                        por Endere&ccedil;o da Empresa </font> <font color="#000000">&gt;&gt;</font> <font color=#000000">

<%response.write busca1%>

                        </strong></font></td>

        </tr>

 

  <% do while not rs2.eof%>

                    <tr >

                      <td colspan="2"background="../imagem/fundodacinza.gif"> <font color="#333333" size="2" face="Arial, Helvetica, sans-serif"><strong>Empresa:</strong></font><font color="#990000" size="2" face="Arial, Helvetica, sans-serif">

                        <strong>

                        <%response.write rs2("empresa")%>

                        </strong></font></td>

        </tr>

        <tr>

          <td><font color="#000000" size="2" face="Arial, Helvetica, sans-serif"><strong>Endere&ccedil;o:

            </strong></font><font color="#000000" size="2" face="Arial, Helvetica, sans-serif">

            <%response.write rs2("Endereco")%>

            </font></td>

          <td><strong><font color="#000000" size="2">Bairro: </font></strong>

            <font color="#000000" size="2" face="Arial, Helvetica, sans-serif">

            <%response.write rs2("Bairro")%>

            </font></td>

        </tr>

        <tr>

                      <td height="23" valign="top"><font size="2" face="Arial, Helvetica, sans-serif"><strong>Telefone:

                        (12)</strong></font><font color="#000000" size="2" face="Arial, Helvetica, sans-serif">

                        <% response.write rs2("Telefone")%>

                        </font> </td>

                      <td valign="top"><font size="2" face="Arial, Helvetica, sans-serif"><strong>Site:</strong></font>

                        <font size="2" face="Arial, Helvetica, sans-serif">: </font>

                        <% if rs2("site")<>"-" then%>

            <a href ="Http://<%=rs2("site")%>"><font color="#000000" size="2" face="Arial, Helvetica, sans-serif">

            <%response.write rs2("Site")%>

            </font>

            <%else%>

            </a><a href ="NaoSite.asp"><font color="#000000" size="2" face="Arial, Helvetica, sans-serif">

            <%response.write rs2("Site")%>

            </font>

            <%end if%>

                        </a> </td>

        </tr>

  <%rs2.movenext%>

        <%loop%>

        <%end if%>

</table>

<% if con.state <> 0 then con.Close

If rs.state <> 0 Then rs.close

If rs2.state <> 0 Then rs2.close

If rs1.state <> 0 Then rs1.close

set con= Nothing

set rs = Nothing

set rs1 = Nothing

set rs2 = Nothing%></td>

  </tr>

</table></td>

</tr>

<tr>

  <td width="779" height="22"></td>

</tr>

</table>

</td>

  </tr>

</table>

</body>

</html>

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this