• 0
Sign in to follow this  
Guest YAKKOO

Select

Question

Guest YAKKOO

BOM DIA GALERA...

AKI TO PRECISANDO DO SEGUINTE:

TENHO ESSE SELECT:

ComandoSQL = "SELECT * FROM email WHERE nome LIKE '%" + Replace(Request.Form("nome"), "'", "''") + "%'"

ELE ME RETORNA APENAS UM NOME...QUERIA QUE ELE ME RETORNASSE TODOS.

POR EXEMPLO: SE EU DIGITAR "MARIA" APARECER TODAS AS "MARIAS" QUE EXISTEM NO BANCO.

ATUALMENTE ELE MOSTRA APENAS A PRIMEIRA.

BIGADIM

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0
Guest YAKKOO

MINHA EXIBICAO TA ASSIM:

<div align="center"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><%Response.Write nome & "<br>"%> </font></strong></font></div>

OLHA ISSO:

<%

Set Conexao = Server.CreateObject("ADODB.Connection")

Conexao.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ= " & server.mappath("bdintranet.mdb")

ComandoSQL = "SELECT * FROM email WHERE nome LIKE '%" + Replace(Request.Form("nome"), "'", "''") + "%'"

Set bd = Conexao.Execute(ComandoSQL)

If NOT bd.EOF Then

nome = bd("nome")

email = bd("email")

End If

%>

Share this post


Link to post
Share on other sites
  • 0

faz assim:

<%
Set Conexao = Server.CreateObject("ADODB.Connection")
Conexao.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ= " & server.mappath("bdintranet.mdb")
ComandoSQL = "SELECT * FROM email WHERE nome LIKE '%" + Replace(Request.Form("nome"), "'", "''") + "%'"
Set bd = Conexao.Execute(ComandoSQL)

Do while not bd.Eof
   nome = bd("nome")
   email = bd("email")
%>
<div align="center"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><%Response.Write nome & "<br>"%> </font></strong></font></div>
<%bd.MoveNext
loop
%>

Share this post


Link to post
Share on other sites
  • 0
Guest YAKKOO

COLEGINHA, TA FUNCIONANDO BLZA...

SO UMA CAOISINHA...porque ESTAO APARECENDO tão LONGE UM DOU OUTRO?

POR EXEMPLO:

JOAO

[email protected]

MARIA

[email protected]

DESSE JEITO?

<table width="63%" border="1" align="center" cellpadding="0" cellspacing="0">

<tr>

<td><div align="right"></div>

<div align="center"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">

<%Response.Write nome & "<br>"%>

<%Response.Write email%>

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

</tr>

<%bd.MoveNext

loop

%>

<tr>

<td>

<div align="center"><a href="teste_busca.asp"><img src="botao_VOLTAR.png" width="120" height="30" border="0"></a></div></td>

</tr>

</table>

Share this post


Link to post
Share on other sites
  • 0
Guest YAKKOO

valeu colega....suas ajudas têm sido MARAVILHOSAS.

obrigada

Share this post


Link to post
Share on other sites

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