Foros del Web » Programando para Internet » ASP Clásico »

Hago busqueda interna, quiero paginarla de 5 en 5

Estas en el tema de Hago busqueda interna, quiero paginarla de 5 en 5 en el foro de ASP Clásico en Foros del Web. Hola: Tengo una pagina web y una base de datos en sql, pues bién, en esta página hago una busqueda por ejemplo por fecha, y ...
  #1 (permalink)  
Antiguo 01/07/2004, 01:58
 
Fecha de Ingreso: abril-2004
Mensajes: 21
Antigüedad: 20 años, 2 meses
Puntos: 0
Hago busqueda interna, quiero paginarla de 5 en 5

Hola:

Tengo una pagina web y una base de datos en sql, pues bién, en esta página hago una busqueda por ejemplo por fecha, y me salen 5 páginas, veo la primera perfectamente, pero cuando paso a la siguiente página viene mi problema ya que me muestra la segunda del total(unas 130) y no de las 5 que inicialmente me habia buscado.

Este es mi codigo, gracias de antemano.

<!-- #include virtual="/bbdd/mysql_conf.asp"-->
<%
DIM SQL, entrada
Set conn = Conectado ()
set rs = Server.CreateObject("ADODB.recordset")
%>
<html>
<head>
<title></title>
<link rel="stylesheet" href="../estilos.css">
<script src="../ultima_hora.js"></script>
</head>
<body bgcolor="#FFFFFF" MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" TOPMARGIN="0" background="/la_manana/imagenes/fondo_manana2.gif">
<!--#include file="include/cabecera.inc" -->
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150" align="left" valign="top"><!--#include file="include/inc_izq.inc" --></td>
<td valign="top" width="500">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="520">&nbsp;</td>
</tr>
<tr align="center">
<td width="520"><img src="imagenes/tit_audioteca.gif" width="466" height="97"></td>
</tr>
<tr align="center" valign="top">
<td width="520">
<table width="470" border="0" cellspacing="0" cellpadding="0" align="center">
<tr >
<td align="center">&nbsp;</td>
</tr>
<tr >
<td align="center">&nbsp;</td>
</tr>
<tr >
<td align="center" >
<table border="0" cellspacing="0" cellpadding="0" align="center" width="450" class="desarrollo">
<tr>
<td class="entradilla">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td valign="top" class="entradilla">
<table width="480" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td valign="top" width="480" class="entradilla">
<table width="480" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3">
<table width="480" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="480" colspan="2" class="destacados">&nbsp;
</td>
</tr>
<tr>
<td align="center" valign="middle" bgcolor="#F0F0F0">&nbsp;
</td>
<td class="entradilla" align="right" valign="top">
<table width="100%" border="0" cellspacing="0" bgcolor="#F0F0F0">
<tr>
<td align="right" valign="top" class="historico">
<b><%
t=request("t1") Aquí me guarda la palabra que pone el usuario a buscar

sql="select * from noticia where seccion=179 and titulo_entradilla like '%"+t+"%' or seccion=180 and titulo_entradilla like '%"+t+"%' "
sql=sql &"or seccion=212 and titulo_entradilla like '%"+t+"%'or seccion=228 and titulo_entradilla like '%"+t+"%' order by posi"

rs.open sql, conn,1,3
rs.pagesize = 5
rs.cachesize = 5
intpagecount = rs.pagecount

select case request("action")
case "<<"
intpage = 1
case "<"
intpage = request("intpage")-1
if intpage < 1 then intpage = 1
case ">"
intpage = request("intpage")+1
if intpage > intpagecount then intpage = intpagecount
Case ">>"
intpage = intpagecount
case else
intpage = 1
end select
%></b>
<form name="MovePage" action="buscador1_diaa.asp" method="post">
<input type="hidden" name="intpage" value="<%=intpage%>">
<input type="submit" name="action" value="&lt;&lt;">
<input type="submit" name="action" value="&lt;">
<input type="submit" name="action" value="&gt;">
<input type="submit" name="action" value="&gt;&gt;">
<input type="hidden" name="secc" value="<%response.write(request("secc"))%>">
Página: <%=intpage & " de " & intpagecount%>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
if not rs.eof then
rs.absolutepage = intpage
for intrecord = 1 to rs.pagesize
if rs.eof then exit for
%>
<table width="480" border="0" cellspacing="0" cellpadding="0">
<tr>
<table width="100%" border="0" cellspacing="1" align="left" cellpadding="1">
<tr align="center">
<td width="120" height="120"><% if rs("foto2")<>"sin foto" then %>
<img src="<%=rs("foto2")%>" width="120" height="120" vspace="5" hspace="5">
<%end if%></td>
</tr>
<tr> <% if rs("pie")<>"-" then %>
<td class="historico"><%=rs("pie")%></td>
<% end if %> </tr>
<tr align="center"> <% if rs("audio")<>"-" then %>
<td class="historico"><a href="/audios/manana/<%=rs("audio")%>"><img src="/imgindex/bescucha.gif" alt="Escucha la noticia" width="118" height="13" border="0"></a></td>
<% end if %> </tr>
<tr align="center"> <% if rs("leer_mas")=1 then %>
<td class="historico"><a href="buscador2.asp?noticia=<%=rs("no")%>"><img src="/imgindex/b_ampliarinfo.gif" alt="Amplia la información de la noticia" width="118" height="13" border="0"></a></td>
<% end if %> </tr>
<tr align="center">
<td class="historico"><img src="/imgindex/5px.gif" width="1" hight="5"></td>
</tr>
</table>
</td>
<td align="center" valign="top" width="485">
<table width="99%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td class="titulonot"><%=rs("titulo_entradilla")%></td>
</tr>
<tr>
<td class="historico" height="86"> <%
entradilla = rs ("entradilla")
'entradilla = replace (entradilla,chr(13), "<br>")
'entradilla = replace (entradilla,chr(61), "&quot;")
response.write(entradilla)
%> <br>
<br>
<br>
<%=response.write(rs ("dia") & "/" & rs("mes") & "/" & rs("annio"))%><br>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"><img src="/imgindex/5px.gif" width="1" height="5"></td>
</tr>
</table>
<%
rs.movenext
next
end if
%> <br>
<table width="480" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="90%" class="entradilla" align="right" valign="top">
<table width="99%" border="0" cellspacing="0" bgcolor="#F0F0F0">
<tr>
<td class="historico" valign="top" align="right">
<form name="MovePage" action="buscador1_dia.asp" method="post">
<input type="hidden" name="intpage" value="<%=intpage%>">
<input type="submit" name="action" value="&lt;&lt;">
<input type="submit" name="action" value="&lt;">
<input type="submit" name="action" value="&gt;">
<input type="submit" name="action" value="&gt;&gt;">
<input type="hidden" name="secc" value="<%response.write(request("secc"))%>">
Página: <%=intpage & " de " & intpagecount%

Gracias por todo de antemano

Última edición por flautel; 01/07/2004 a las 04:14
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:56.