Jump to content


Photo

Alguém Pode Me Dar Um Peixe?


  • Faça o login para participar
Nenhuma resposta neste tópico

#1 cidadao_cane

cidadao_cane

    Normal

  • Usuários
  • 94 posts
  • Sexo:Não informado

Posted 23/01/2004, 10:46

Pessoal,

Sei que o melhor é ensinar a pescar e não dar o peixe, mas nesse caso estou pedindo o PEIXE, pois não estou sabendo pescar.
Preciso colocar paginação neste código, pois os resultados da busca são muitos. Tem que ser neste código e eu não sei nada sobre paginação. Se alguém puder me ajudar peço que faça no código.

Eu preciso que coloquem a paginação no código literalmente. Já tentei várias vezes e não consegui, seguindo dicas e exemplos.


<% If Request.QueryString("mode") = "doit" Then

If Trim(Request.Form("SearchString")) = "" Then

Response.Write("<br><br><p align='center'><b>Você deve especificar uma busca!</b>")
Response.Write("<p align='center'><a href='buscar_eventos.asp'>Voltar!</a></p>")

Else

StrSQL = "SELECT IDNews, NewsHeadline, NewsDate FROM News WHERE IDNews AND releaseDate <= NOW() AND (expireDate >= NOW() OR expireDate IS NULL) AND"

If Not Request.Form("SearchHeader") = "yes" Then

StrSQL = StrSQL & " (NewsText LIKE '%" & Trim(Request.Form("SearchString")) & "%'"

Else

If Not Request.Form("SearchText") = "yes" Then

StrSQL = StrSQL & " (NewsHeadline LIKE '%" & Trim(Request.Form("SearchString")) & "%'"

Else

StrSQL = StrSQL & " (NewsHeadline LIKE '%" & Trim(Request.Form("SearchString")) & "%'"
StrSQL = StrSQL & " OR NewsText LIKE '%" & Trim(Request.Form("SearchString")) & "%'"

End If


End If

StrSQL = StrSQL & ") ORDER BY NewsDate DESC, IDNews DESC"

Set objConnesp = Server.CreateObject("ADODB.Connection")
Set objRs = Server.CreateObject("ADODB.Recordset")
objConnesp.Open strConnesp
objRs.Open StrSQL, objConnesp, 0, 1
%>
<table border="0" cellpadding="0" cellspacing="0" width="90%" align="center">
<tr>
<td valign="top">&nbsp;</td>
</tr>
<tr>
<td valign="top">
<div align="right"><a href="buscar_noticias.asp"><img src="../pic/pesqoutra.gif" width="151" height="11" border="0" alt="Nova pesquisa"></a></div>
</td>
</tr>
<tr>
<td valign="top"><b>A sua procura por "<i> <font color="#CC0000">
<% = Request.Form("SearchString") %>
</font></i>" encontrou os seguintes resultados: </b></td>
</tr>
<tr>
<td>&nbsp; </td>
</tr>
<tr>
<td valign="top"> <small> <font color="#999999">A</font><font color="#999999">s
<b><font color="#FF9933">seguintes</font></b> noticias foram <b><font color="#FF9900">inc</font></b>lu&iacute;das
na <b><font color="#FF9900">sua</font></b> pesquisa.<br>
Clique no <b><font color="#FF9900">t&iacute;tulo</font></b> da not&iacute;cia
para ver a noticia completa. </font></small> </td>
</tr>
</table>
<br><br>
<%
If objRs.BOF And objRs.EOF Then
%>
<table border="0" cellpadding="0" cellspacing="0" width="90%" align="center">
<tr>

<td valign="top"> <font color="#CC0000">A sua pesquisa... n&atilde;o encontrou
nada...</font></td>
</tr>
<tr>

<td valign="top"> <a href="buscar_noticias.asp">Clique aqui para tentar
novamente!</a>
<td>
</tr>
</table>
<%
Else
%>
<table border="0" cellpadding="0" cellspacing="0" width="90%" align="center">
<%
nRun = 1
Do While Not objRs.EOF
%>
<tr>

<td valign="top" style="padding-top: 3px;"> <b> <font color="#0066FF">
<%
If Application(ScriptName & "OneSheet") = "Yes" Then
%>
<% = nRun %>
.)</font></b> <a href="um_esportes.asp?IDNews=<% = objRs("IDNews") %>">
<% = objRs("NewsHeadline") %>
</a> <small><font color="#CCCCCC">(
<% = FormatDateTime(objRs("NewsDate"), vb script:history.go(-1)">Voltar</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>

<% End if
%>


Valeu Mesmo

Edição feita por: cidadao_cane, 23/01/2004, 20:35.





0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq