
24/01/2002, 16:08
|
 | | | Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 23 años, 4 meses Puntos: 1 | |
Re: Botones anterior siguiente... encontre el siguiente codigo espero que te sirva el link anterior es por si usas links para navegar entre las paginas pero si usas botones aqui esta
salu2
<HTML>
<TITLE> Paginar una tabla </TITLE>
<BODY>
<!-- #INCLUDE File="ADOVBS.inc" -->
<% IF (Request.QueryString ("Pagina") = "Pagina Siguiente") THEN
Session ("Pagina")= Session ("Pagina") + 1
ELSE IF (Request.QueryString ("Pagina") = "Pagina Anterior") THEN
Session ("Pagina")= Session ("Pagina") - 1
ELSE Session ("Pagina")= 1
END IF
END IF
Set Ob_Conn = Server.CreateObject ("ADODB.Connection")
Set Ob_RS = Server.CreateObject ("ADODB.RecordSet")
Ob_Conn.Open "EjemploBD"
Ob_RS.Open "Fichas", Ob_Conn, adOpenStatic, adCmdTable
Ob_RS.PageSize = 9
Ob_RS.AbsolutePage = Session ("Pagina") %>
<H3> PAGINA <%= Session ("Pagina") %> DE <%= Ob_RS.PageCount %></H3>
<TABLE BORDER=1>
<TR>
<TH> DNI </TH>
<TH> NOMBRE </TH>
<TH> APELLIDOS </TH>
<TH> DIRECCION </TH>
<TH> TELEFONO </TH>
<% Registro=0
DO WHILE Registro < 9 AND NOT Ob_RS.Eof %>
<TR>
<TD><%= Ob_RS ("DNI") %></TD>
<TD><%= Ob_RS ("Nombre") %></TD>
<TD><%= Ob_RS ("Apellidos") %></TD>
<TD><%= Ob_RS ("Dirección") %></TD>
<TD><%= Ob_RS ("Teléfono") %></TD>
<% Registro = Registro + 1
Ob_RS.MoveNext
LOOP
Response.Write "</TABLE>" %>
<BR>
<FORM METHOD="Get" ACTION="EjBD6.asp">
<% IF Session ("Pagina") > 1 THEN %>
<INPUT TYPE="Submit" VALUE="Pagina Anterior" NAME="Pagina"><BR>
<% END IF
IF Session ("Pagina") < Ob_RS.PageCount THEN %>
<INPUT TYPE="Submit" VALUE="Pagina Siguiente" NAME="Pagina">
<% END IF %>
</FORM>
<% Ob_RS.Close
Ob_Conn.Close %>
</BODY>
</HTML>
<embed src="http://www.autocar.com.mx/images/logo.swf" type="application/x-shockwave-flash" width="468" height="60" play="true" wmode="transparent" menu="false" loop="true"> |