Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

vinicius015

Q q ocorre de errado aki....

Recommended Posts

Iae galera beleza, eu tenho um sitema de busca... ele fununcia normal.. mas quando eu vo pesquisar nomes com palavras de 1 ou 2 algarismos, ele no aparece o resultado... melhor ele queima a pesqisa por causa desses algarismos... por exemplo;

um nome de um bairro PARQUE DO CARMO, se eu procurar como esta escirto ai corretamente ele nao acaha o resultado, para poder achar eu tenho que escrver PARQUE CARMO, o mesmo acontece, quando utilizo número... tipo 1 ou 2 algarismos numericos.

 

 

OU MELHOR EXPLICANDO......

 

Eu adiciono um tópico a ser pesquisado, do seguinte modo,

com as seguintes palavras chaves;

ZONA LESTE PARQUE DO CARMO

 

só que se eu digito as palavras chaves exatas, como esta escrito acima, nao funciona.

Para fncionar eu tenho que escrveer assim

ZONA LESTE PARQUE CARMO - sem o DO

 

se eu escrevo o DO entre a palavra PARQUE e CARMO, ele NÃO mostra resultado que eu adicionei,

 

acho que tem alguma coisa no codigo fonte que anula a pesquisa, se possuir somente 2 ou menos algarismos na pesquisa.

 

 

 

-------------------------------------- AI VA O CODIGO... VALEW

 

 

If Request.QueryString("mode") = "" OR IsEmpty (Request.QueryString("mode")) Then

Dim categorias,temp,num_itens,links

strSQL = "SELECT * From tblCategory WHERE ref LIKE '"

If Request.QueryString("ref") <> "" AND NOT IsEmpty(Request.QueryString("ref")) Then

strSQL = strSQL & Request.QueryString("ref")

End If

strSQL = strSQL & "_' ORDER BY name;"

set categorias = adoCon.Execute(strSQL)

temp = 0

If NOT categorias.EOF Then

Response.Write "<hr width=""530px""><table class=""text"" cellpadding=""0"" cellspacing=""0"" width=""530px"" border=""0"" align=""center""><tr><td>"

While NOT categorias.EOF

temp = temp + 3

categorias.MoveNext

Wend

categorias.MoveFirst

num_itens = temp/5

if num_itens < 5 Then

num_itens = 3

End If

temp = 1

While NOT categorias.EOF

if temp > num_itens Then

Response.Write "</table></td><td>"

temp = 1

End If

If temp = 1 Then

Response.Write "<table border=""0"">"

End If

Response.Write "<tr><td><a href=""default.asp?ref=" & categorias("ref") & """>" & categorias("name") & "</a></td></tr>"

temp = temp + 1

categorias.MoveNext

Wend

Response.Write "</td></tr></table></td></tr></table><hr width=""530px"">"

End If

If Not IsEmpty(Request.QueryString("ref")) Then

Response.Write "<span class=""text""></span><br>"

strSQL = "SELECT * From tblWebsites WHERE category = '" & Request.QueryString("ref") & "' ORDER By Rating DESC, No_of_ratings DESC, Hits DESC ;"

set rsSearchResults = adoCon.Execute(strSQL)

Response.Write vb script:window.open('get_url.asp?SiteID=" & CInt(rsSearchResults("SiteIDNo")) & "', 'RESULTADO', 'width=800,height=600, menubar=0, statusbar=0');"">" & rsSearchResults("Title") & "</a>"

Response.Write vb script:window.open('get_url.asp?SiteID=" & CInt(rsSearchResults("SiteIDNo")) & "', 'RESULTADO', 'width=800,height=600, menubar=0, statusbar=0');"">" & rsSearchResults("Title") & "</a>"

Response.Write vbCrLf & " <br>"

Response.Write vbCrLf & " " & rsSearchResults("Description")

Response.Write vbCrLf & " <br>"

Response.Write vbCrLf & " <span class=""italic""<a href=" & "','rate_site')"" style=""font-size:" & intTextSize-1 & "; font-style: italic;""></a>- Nº. de Visitas :  " & CInt(rsSearchResults("Hits")) & """</span>"

Response.Write vbCrLf & " <br><br>"

 

'Move to the next record in the database

rsSearchResults.MoveNext

 

'Loop back round

Next

End If

 

'Close the HTML table displaying the results

Response.Write vbCrLf & " </td>"

Response.Write vbCrLf & " </tr>"

Response.Write vbCrLf & " </table>"

 

 

 

 

'If there are more pages to display then add a title to the other pages

If intRecordPositionPageNum > 1 OR NOT rsSearchResults.EOF AND blnSearchWordLenthOK = True Then

 

'Display an HTML table with links to the other search results

Response.Write vbCrLf & " <table width=""530x"" border=""0"" cellspacing=""0"" cellpadding=""0"" align=""center"">"

Response.Write vbCrLf & " <tr>"

Response.Write vbCrLf & " <td>"

Response.Write vbCrLf & " <table width=""530px"" border=""0"" cellpadding=""0"" cellspacing=""0"">"

Response.Write vbCrLf & " <tr>"

Response.Write vbCrLf & " <td width=""530px"" align=""center"" class=""text"">"

 

'If there are more pages to display then add a title to the other pages

If intRecordPositionPageNum > 1 or NOT rsSearchResults.EOF Then

Response.Write vbCrLf & " Resultadosde Páginas:  "

End If

 

'If the page number is higher than page 1 then display a back link

If intRecordPositionPageNum > 1 Then

Response.Write vbCrLf & " <a href=""default.asp?PagePosition=" & intRecordPositionPageNum - 1 & "&search=" & Server.URLEncode(strSearchKeywords) & "&mode=" & Request.QueryString("mode") &""" target=""_self""><< Anterior</a>  "

End If

 

 

'If there are more pages to display then display links to all the search results pages

If intRecordPositionPageNum > 1 or NOT rsSearchResults.EOF Then

 

'Loop to diplay a hyper-link to each page in the search results

For intLinkPageNum = 1 to lngTotalNumPages

 

'If the page to be linked to is the page displayed then don't make it a hyper-link

If intLinkPageNum = intRecordPositionPageNum Then

Response.Write vbCrLf & " " & intLinkPageNum

Else

 

Response.Write vbCrLf & "  <a href=""default.asp?PagePosition=" & intLinkPageNum & "&search=" & Server.URLEncode(strSearchKeywords) & "&mode=" & Request.QueryString("mode") & """ target=""_self"">" & intLinkPageNum & "</a>  "

End If

Next

End If

 

 

'If it is Not the End of the search results than display a next link

If NOT rsSearchResults.EOF then

Response.Write vbCrLf & "  <a href=""default.asp?PagePosition=" & intRecordPositionPageNum + 1 & "&search=" & Server.URLEncode(strSearchKeywords) & "&mode=" & Request.QueryString("mode") & """ target=""_self"">Próxima >></a>"

End If

 

 

'Finsh HTML the table

Response.Write vbCrLf & " </td>"

Response.Write vbCrLf & " </tr>"

Response.Write vbCrLf & " </table>"

Response.Write vbCrLf & " </td>"

Response.Write vbCrLf & " </tr>"

Response.Write vbCrLf & " </table>"

Response.Write vbCrLf & " <br>"

 

End If

End If

 

 

'Close Server Objects

Set rsSearchResults = Nothing

Set strCon = Nothing

Set adoCon = Nothing

 

-----------------------------------------------------------------------------------------

 

 

JÁ POSTARAM ISSO PRA MIM FAZER... MAS NAO DEU CERTO...

 

antes da linha de execução da consulta...

 

 set categorias = adoCon.Execute(strSQL)

coloque

 

response.write strSQLresponse.flush

 

-------------------------------------------------

 

VALEW GALERA ESPERO A SOLUCION....ESTOU ENCURRALADO COM ISSO...

YYYYYYYEEEEEESSSSSSSSSSS!!!!

 

VINICIUS

Compartilhar este post


Link para o post
Compartilhar em outros sites

o que aperece na tela depois deresponse.write strSQLresponse.flushou nem chega neste ponte de execução

Compartilhar este post


Link para o post
Compartilhar em outros sites

nao entendi???eu nao manjo nada... rsrsrsse você fala assim temn que colocar tal coisa... em cima de tal coisa... ai eu sei... mas agora outras coisa nao manjo...tipo eu só colkei do jeito que falaram e nao deu certo.....

Compartilhar este post


Link para o post
Compartilhar em outros sites

a dica do amigo marioufpa serve para debugar, para ver onde está o erro.coloque depois desse trecho:strSQL = "SELECT * From tblCategory WHERE ref LIKE '"

If Request.QueryString("ref") <> "" AND NOT IsEmpty(Request.QueryString("ref")) Then  strSQL = strSQL & Request.QueryString("ref")End IfstrSQL = strSQL & "_' ORDER BY name;"

Compartilhar este post


Link para o post
Compartilhar em outros sites

response.write strSQLresponse.flush

Quando chegar neste ponto da pagina deverá escrever na tela a string SQL que está sendo usada, ai aria pra gente ver o que pode está saindo errado

Compartilhar este post


Link para o post
Compartilhar em outros sites

strSQL = strSQL & "_' ORDER BY name;"

esta _ tem que estár ai mesmo?cara se você fizer o que foi pedido, fica muito mas simples de ajudar você.

Compartilhar este post


Link para o post
Compartilhar em outros sites

ae pessoal... eu novamente colokei isso

response.write strSQL	response.flush

 

 

junto ao código e fikou assim

 

End If	strSQL = strSQL & "__' ORDER BY name;"	set categorias = adoCon.Execute(strSQL)	response.write strSQL                response.flush	temp = 0

lembrando que tem mais código para cima e para baixo....

 

 

e quando colokei isso e atualizei a pagina, aparaceu a seguinte menssagem um pouco abaixo do campo busca;

SELECT * From tblCategory WHERE ref LIKE '__' ORDER BY name;

 

vejam melhor abaixo na imagem... nao liguem na cor azul clara que ficou foi o

 

Figura....

 

valew galera espeor que vcspossam em ajudarrr

Compartilhar este post


Link para o post
Compartilhar em outros sites

cara manda o banco denovo pro meu email, mais agora com varios dados cadastrados, pois ele ta vazio e eu tou meio sem tempo pra ficar carragdo seu banco, inventa dados, não precisam ser reais que dou uma olhado no seu codigo.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.