Jump to content
Fórum Script Brasil
  • 0

Páginação


Guest Gi
 Share

Question

Como faço nesse codigo para mostrar apenas 15 registros por página e colocar Pagina 1 de 2...Obrigado

<%

option explicit

dim Conn, rsQuery, SQLString

dim dsResultado, i, dsCab, dsCategoria, dsCategoriaCheck

%>

<!--#include file="includes/Conn.asp"-->

<%

Set rsQuery = Server.CreateObject("ADODB.RecordSet")

SQLString = "SELECT CAT.CAT_TXT_DESCRICAO AS CATEGORIA, COM.COM_NUM_CODIGO AS CODIGO, COM_TXT_NOME AS NOME, COM.COM_TXT_BAIRRO AS BAIRRO, COM.COM_TXT_ESTADO AS ESTADO ,COM.COM_TXT_CIDADE AS CIDADE FROM CAT, COM WHERE "

If Len(Trim(Request.form("keyword"))) <> 0 then

SQLString = SQLString&" COM.COM_TXT_NOME LIKE '%"&Request.form("keyword")&"%' AND"

End If

If Request.form("idCat") <> "all" then

SQLString = SQLString&" CAT.CAT_NUM_CODIGO = "&Request.form("idCat")&" AND CAT.CAT_NUM_CODIGO = COM.CAT_NUM_CODIGO"

Else

SQLString = SQLString&" CAT.CAT_NUM_CODIGO = COM.CAT_NUM_CODIGO"

End If

If Request.form("dsBairro") <> "all" then

SQLString = SQLString&" AND COM.COM_TXT_BAIRRO = '"&Request.form("dsBairro")&"'"

End If

If Request.form("dsCidade") <> "all" then

SQLString = SQLString&" AND COM.COM_TXT_CIDADE = '"&Request.form("dsCidade")&"'"

End If

If Request.form("dsEstado") <> "all" then

SQLString = SQLString&" AND COM.COM_TXT_ESTADO = '"&Request.form("dsEstado")&"'"

End If

SQLString = SQLString&" AND COM.COM_FL_ATIVO = '1' GROUP BY CAT.CAT_TXT_DESCRICAO, COM.COM_TXT_BAIRRO, COM.COM_TXT_CIDADE, COM.COM_TXT_ESTADO, COM.COM_TXT_NOME, COM.COM_NUM_CODIGO ORDER BY 1,2 ASC"

On Error Resume Next

rsQuery.Open SQLstring, Conn

dsResultado = ""

dsCategoriaCheck = ""

If rsQuery.EoF Then

dsCab = "<font face=""verdana"" size=""1""><b>Não foram encontrados resultados para a sua busca!"

Else

i = 0

while not rsQuery.EoF

dsCategoria = rsQuery("CATEGORIA")

If dsCategoria <> dsCategoriaCheck Then

dsResultado = dsResultado&"<font face=""verdana"" size=""1"" color=003366><b>"&dsCategoria&"</b></font>"

End If

i = (i + 1)

dsResultado = dsResultado & "<tr><td><font face=""verdana"" size=""1"" color=#003366><b><a href=""dspMostraDet.asp?idEst="&rsQuery("CODIGO")&""" target=""_self"">"&rsQuery("NOME")&"</a> </b><br> "&rsQuery("BAIRRO")&"<br>"&rsQuery("CIDADE")&" - "&rsQuery("ESTADO")&" <br></font><table width=600 border=0><tr><td><a href=""dspMostraDet.asp?idEst="&rsQuery("CODIGO")&""" target=""_self""><img src=http://www.checkpoint.com.br/site/img/detalhes.gif border=0></a></td><td><img src=http://www.checkpoint.com.br/site/img/reservar.gif></td></tr></table></td></tr><br><br>"

dsCategoriaCheck = dsCategoria

rsQuery.Movenext

wend

If i = 1 Then

dsCab = "<font face=""verdana"" size=""1""><b>Foi encontrado "&i&" registro para a sua busca!"

Else

dsCab = "<font face=""verdana"" size=""1""><b>Foram encontrados "&i&" registros para a sua busca!"

End If

End If

rsQuery.Close

Conn.Close

Set rsQuery = Nothing

Set Conn = Nothing

%>

Link to comment
Share on other sites

5 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.

 Share



  • Forum Statistics

    • Total Topics
      150.8k
    • Total Posts
      648.5k
×
×
  • Create New...