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

Paginar lo paginado

Estas en el tema de Paginar lo paginado en el foro de ASP Clásico en Foros del Web. Hola, necesito que de una pagina que esta paginada me anlaze con otra y que a su vez estos resultados tambien salgan paginados. el problema ...
  #1 (permalink)  
Antiguo 04/01/2002, 08:29
 
Fecha de Ingreso: diciembre-2001
Mensajes: 28
Antigüedad: 22 años, 5 meses
Puntos: 0
Paginar lo paginado

Hola, necesito que de una pagina que esta paginada me anlaze con otra y que a su vez estos resultados tambien salgan paginados.
el problema lo tengo en que todo va bien, pero la pgina con el resultado final no la consigo paginar.
Si alguien me puede ayudar se lo agradecere ya que estoy perdida y no tengo ni idea. Mil Gracias.
  #2 (permalink)  
Antiguo 04/01/2002, 09:42
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 22 años, 5 meses
Puntos: 1
Re: Paginar lo paginado

mm sinceramente no me quedo claro :(
si lo explicas mas claramente con mucho gusto pienso en como ayudar

salu2

<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">
  #3 (permalink)  
Antiguo 04/01/2002, 09:52
 
Fecha de Ingreso: diciembre-2001
Mensajes: 28
Antigüedad: 22 años, 5 meses
Puntos: 0
Re: Paginar lo paginado

Te explico y gracias por ayudarme.
Estoy haciendome una web de citas celebres, te lo cuento porque me resulta mas facil de explicar ya que me lio.
Pues por ejemplo tengo una pagina con los resultados de los autores que empiezan por la letra &quot;A&quot; que la tengo paginada de 10 en 10, al pinchar en un autor como por ejempl Aristoteles me sale en otra pagina el resultado de las citas y lo que yo quiero es que este resultado con las citas de Aristoteles (por ejemplo) me salga paginado pues de 10 en 10 tambien.
No se si lo entenderas, espero no haberte liado, y gracis de nuevo.
  #4 (permalink)  
Antiguo 04/01/2002, 10:31
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 22 años, 5 meses
Puntos: 1
Re: Paginar lo paginado

pues si ya tienes paginado los resultados de los autores no encuentro cual puede ser el problema, unicamente pagina los resultados de cuando den clic en algun autor, y utilizas la misma tecnica... o no? bueno digo yo no sera otro el problema?

salu2

<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">
  #5 (permalink)  
Antiguo 04/01/2002, 12:04
 
Fecha de Ingreso: diciembre-2001
Mensajes: 28
Antigüedad: 22 años, 5 meses
Puntos: 0
Re: Paginar lo paginado

si, pero no consigo las dos caosas a la vez, cuando consigo paginar no me vincula los datos y me salen todas las citas, es decir, me salen todas las citas de todos los autores peropaginadas, y cuando me vincula la cita de cada autor entonces no me pagina, no consigo hacer las dos cosas a la vez y que me vincule y me pagine. algo hago mal pero no se el que
  #6 (permalink)  
Antiguo 04/01/2002, 12:14
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 22 años, 5 meses
Puntos: 1
Re: Paginar lo paginado

oh ahora entiendo yo he sufrido de lo mismo y es por lo siguiente cuando paginas con los resultados del autor necesitas pasar a cada pagina el autor tu debes estar haciendo algo asi en el link que te manda a la siguiente pagina


&lt;a href=&quot;detalles.asp?Pagina=&lt;%=PaginaActual+ 1%&gt;&quot;&gt;Siguientes&lt;/a&gt;

pero no estas pasando el nombre del autor

por lo cual debes poner algo asi

&lt;a href=&quot;detalles.asp?Pagina=&lt;%=PaginaActual+ 1%&gt;&amp;amp;Autor=&lt;%=Autor%&gt;&quot;&gt;Sig uientes&lt;/a&gt;


Con lo cual a cada pagina le estas pasando el nombre del autor

bueno le faltan varias cosas como asignar a la variable autor el nombre que recogas ya se con querystring o con request form

salu2

dime si era eso





<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">
  #7 (permalink)  
Antiguo 04/01/2002, 12:44
 
Fecha de Ingreso: diciembre-2001
Mensajes: 28
Antigüedad: 22 años, 5 meses
Puntos: 0
Re: Paginar lo paginado

!! Exacto !! es eso lo que me pasa, pero soy un poco brutita y no se como ponerlo, estoy ya bloqueada de tanto inteno.
Yongo esto:
&lt;A HREF=verCita.asp?pagina=&quot;&amp; pag_actual-1&amp; &quot;&gt;10 anteriores&lt;/A&gt;
ahorabien, al poner lo que tu me dices me hago un lio con &lt;% y con %&gt; no lo debo de poner bien, perdona que te de la lata pero ¿como lo pongo? he probado ya tanto que creo que cada vez lo empeoro.
Mil gracias por tu ayuda.
  #8 (permalink)  
Antiguo 04/01/2002, 12:49
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 22 años, 5 meses
Puntos: 1
Re: Paginar lo paginado

ok

por ejemplo recoges el parametro

&lt;%
'el siguiente querystring depende de con que variable lo pases
Autor=Request.QueryString(&quot;Autor&quot;)

%&gt;

no se cual de las siguientes este bien

1.-
&lt;A HREF=verCita.asp?pagina=&quot;&amp;pag_actual-1&amp;Autor=&lt;%Server.UrlEncode(Autor)%&gt; &quot;&gt;10 anteriores&lt;/A&gt;

2.-
&lt;A HREF=verCita.asp?pagina=&quot;&amp;pag_actual-1&amp;Autor=&lt;%=Server.UrlEncode(Autor)%&gt; &quot;&gt;10 anteriores&lt;/A&gt;

Avisame si te quedo y con cual de las 2

salu2

<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">
  #9 (permalink)  
Antiguo 04/01/2002, 13:02
 
Fecha de Ingreso: diciembre-2001
Mensajes: 28
Antigüedad: 22 años, 5 meses
Puntos: 0
Re: Paginar lo paginado

Urjose, desisto, te mando todo lo que pongo y dime si puedo hacer algo con ello, a lo mejor es que el problema no esta ahi solo.

Esto es lo que yo pongo, el ultimo parrafo intento poner lo que me dices pero me debe faltar algun parametro(segun me dice el error)¡¡¡ Aghhhhh !!!
&lt;%
Dim Conn, RS, mostrar, pag_totales, pag_actual
Set Conn = Server.CreateObject (&quot;ADODB.Connection&quot;)
Set RS = Server.CreateObject (&quot;ADODB.RecordSet&quot;)
Conn.Open &quot;DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=&quot;&amp;Server.MapPath(&quot;../../CitasCelebres.mdb&quot;)
sql = &quot;SELECT * FROM conCitas&quot;
RS.Open sql, Conn,3,1

mostrar = 10
rs.PageSize = mostrar
rs.CacheSize = mostrar

if Request.Querystring(&quot;pagina&quot;)=&quot;&quo t; then
pag_actual=1
else
pag_actual=CInt(Request.Querystring(&quot;pagina&q uot;))
end if

pag_totales = rs.PageCount

if pag_actual &lt; 1 then
pag_actual = 1
end if
if pag_actual &gt; pag_totales then
pag_actual = pag_totales
end if

if pag_totales=0 then
Response.Write(&quot;No hay Autores.&quot;)
else
rs.AbsolutePage = pag_actual
Response.Write &quot;&lt;TABLE ALIGN=down WIDTH=114% CELLPADDING=0 CELLSPACING=0 BORDER=0&gt;&lt;TR&gt;&lt;TD&gt;&quot;
Response.Write &quot;&lt;/TD&gt;&lt;TD ALIGN=right VALIGN=top&gt;&quot;
Response.Write(&quot;Página &quot; &amp; Pag_actual &amp; &quot; de &quot; &amp; pag_totales &amp;&quot;&lt;BR&gt;&quot;)
cant_registros = 0
Response.Write(&quot;&lt;a target=inferiord href=../Portadas/PortadaInicialABC/InicialABC.htm&gt;Volver&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp; nbsp;&amp;nbsp;&quot;)
if pag_actual &gt; 1 then
Response.Write(&quot;&lt;A HREF=verCita.asp?pagina=&quot;&amp; pag_actual-1&amp; &quot;&gt;10 anteriores&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot ;)
end if



if pag_actual &lt; pag_totales then
Response.Write(&quot;&lt;A HREF=verCita.asp?pagina=&quot;&amp; pag_actual+1&amp;ncita=&lt;%Server.UrlEncode(IdAut or)%&gt;&quot;&gt;10 anteriores&lt;/a&gt;&quot;)
end if%&gt;
  #10 (permalink)  
Antiguo 04/01/2002, 13:08
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 22 años, 5 meses
Puntos: 1
Re: Paginar lo paginado

creo que te falta algo asi

idAutor=Request.QueryString(&quot;ncita&quot;)


sql = &quot;SELECT * FROM conCitas Where IdAutor=&quot;&amp;IdAutor&amp;&quot;&quot;

Response.Write(&quot;&lt;A HREF=verCita.asp?pagina=&quot;&amp; pag_actual+1&amp;ncita=&lt;%Server.UrlEncode(IdAut or)%&gt;&quot;&gt;10 anteriores&lt;/a&gt;&quot;)

seguimos en contacto

<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">
  #11 (permalink)  
Antiguo 04/01/2002, 13:27
 
Fecha de Ingreso: diciembre-2001
Mensajes: 28
Antigüedad: 22 años, 5 meses
Puntos: 0
Re: Paginar lo paginado

if pag_actual &lt; pag_totales then
Response.Write(&quot;&lt;A HREF=verCita.asp?pagina=&quot;&amp; pag_actual+1&amp;ncita=&lt;%Server.UrlEncode(IdAut or)&quot;&gt;10 anteriores&lt;/a&gt;&quot;)
end if%&gt;



Este es el problema (creo) que todo me sale en color rojo, y a partir de lo que resalto en negrita parece que se rompe el codigo (o lo que sea) en el momento que le quito %&gt; se ve bien, pero claro, no esta bien. Yo sigo con el tema, pero ya es por cabezoneria, lo tengo que conseguir. Gracias por tu paciencia
  #12 (permalink)  
Antiguo 04/01/2002, 13:33
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 22 años, 5 meses
Puntos: 1
Re: Paginar lo paginado

aqui tienes un espacio que no debe ir no se si sea eso

verCita.asp?pagina=&quot;&amp;(Aqui hay un espacio)pag_actual

<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">
  #13 (permalink)  
Antiguo 04/01/2002, 13:49
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 22 años, 5 meses
Puntos: 1
Re: Paginar lo paginado

te dejo lo que utilizo yo es lo mismo que tu haces espero que sea de ayuda

&lt;%
Estado=Request.QueryString(&quot;Estado&quot;) 'En tu caso seria recoger el autor

Dim oConn, oRs, sSQL
Dim PaginaActual, PaginasTotales, TamPagina,CuantosRegistros

Tampagina=10

If Request.QueryString(&quot;Pagina&quot;)=&quot;&quo t; Then
PaginaActual=1
Else
PaginaActual=CInt(Request.QueryString(&quot;Pagina &quot;) )
End If

Set oConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
Set oRs= Server.CreateObject(&quot;ADODB.Recordset&quot;)

oConn.Open(&quot;&quot;)

sSQL = &quot;SELECT IdAuto, EstadoRepublica, TipoDeAuto, Marca, Modelo, ColorInterior, ColorExterior, Anio, Precio, Fecha FROM ClasificadosG Where TipoDeAuto='Automóviles' AND EstadoRepublica='&quot;&amp; Estado &amp;&quot;' ORDER BY IdAuto DESC&quot;

oRs.pageSize=TamPagina
oRs.CacheSize=TamPagina

oRs.CursorLocation=3


'Set oRS = oConn.Execute(sSQL)

oRs.Open sSQL, oConn, 1, 2

PaginasTotales=oRs.PageCount

If PaginaActual &lt; 1 Then
PaginaActual=1
End If

If PaginaActual &gt; PaginasTotales Then
PaginaActual=PaginasTotales
End If%&gt;




&lt;b&gt;&lt;font size=&quot;2&quot; color=&quot;#FF0000&quot; face=&quot;Arial&quot;&gt;
&lt;p align=&quot;center&quot;&gt;&lt;%If PaginaActual &gt; 1 Then%&gt;&lt;font color=&quot;#FF0000&quot;&gt;&lt;a href=&quot;index.asp?Pagina=&lt;%=PaginaActual-1%&gt;&amp;amp;Estado=&lt;%=Estado%&gt;&quot;&gt;& lt;b&gt;&lt;font size=&quot;2&quot; face=&quot;Arial&quot;&gt;Anteriores-&lt;/font&gt;&lt;/b&gt;&lt;%End If%&gt;&lt;/a&gt;&lt;font size=&quot;2&quot; color=&quot;#FF0000&quot; face=&quot;Arial&quot;&gt;&lt;b&gt;&amp;nbsp;
&lt;%If PaginaActual &lt; PaginasTotales Then%&gt;&lt;a href=&quot;index.asp?Pagina=&lt;%=PaginaActual+1%& gt;&amp;amp;Estado=&lt;%=Estado%&gt;&quot;&gt;Sigu ientes&lt;/a&gt;&lt;%End If%&gt;&lt;/b&gt;&lt;/font&gt;
&lt;/font&gt;&lt;font color=&quot;#FF0000&quot;&gt; &lt;/font&gt;
&lt;/font&gt; &lt;/b&gt;

<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">
  #14 (permalink)  
Antiguo 04/01/2002, 16:49
 
Fecha de Ingreso: diciembre-2001
Mensajes: 28
Antigüedad: 22 años, 5 meses
Puntos: 0
Re: Paginar lo paginado

Hola urjose, perdona por la tardanza.

Veras, me ha ido fenomenal lo que me mandas, pero tengo un pequeño problemiña (para variar) ahora el problema le tengo en que no se como poner de que tabla tiene que coger los datos. He probado mil formas y nada.

SQL = &quot;SELECT * FROM conCitas where IdAutor=&quot;&amp;ncita&amp;&quot;&quot;

SQL = &quot;SELECT * FROM conCitas&quot;

Al poner esto me abre todas las citas paginadas, pero claro, yo quiero que me abra solo las del autor del enlace.

Bueno, espero que con esto me pueas ayudar y lo consiga......

Gracias.

  #15 (permalink)  
Antiguo 04/01/2002, 19:23
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 22 años, 5 meses
Puntos: 1
Re: Paginar lo paginado

ok

SQL = &quot;SELECT * FROM conCitas where IdAutor=&quot;&amp;ncita&amp;&quot;&quot;

usas lo anterior si ncita es un numero pero si ncita es texto usas asi

SQL = &quot;SELECT * FROM conCitas where IdAutor='&quot;&amp;ncita&amp;&quot;'&quot;

espero que sea eso salu2

<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">
  #16 (permalink)  
Antiguo 04/01/2002, 19:36
 
Fecha de Ingreso: diciembre-2001
Mensajes: 28
Antigüedad: 22 años, 5 meses
Puntos: 0
Re: Paginar lo paginado

Otra vez aqui, menuda paciencia tienes conmigo

bueno, creo que avanzo, me sale la lista con las citas del autor que selecciono y paginado, el problema es cuando le doy a que me muestra los 10 siguinetes que me da error, voy a seguir probando, pero si sabes algo.......... aqui te espero.....
  #17 (permalink)  
Antiguo 04/01/2002, 19:39
 
Fecha de Ingreso: diciembre-2001
Mensajes: 28
Antigüedad: 22 años, 5 meses
Puntos: 0
Re: Paginar lo paginado

Otra vez aqui, menuda paciencia tienes conmigo

bueno, creo que avanzo, me sale la lista con las citas del autor que selecciono y paginado, el problema es cuando le doy a que me muestra los 10 siguinetes que me da error, voy a seguir probando, pero si sabes algo.......... aqui te espero.....
  #18 (permalink)  
Antiguo 04/01/2002, 19:40
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 22 años, 5 meses
Puntos: 1
Re: Paginar lo paginado

que error te da y en que linea

y manda la linea en que esta el error

salu2 :)

<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">
  #19 (permalink)  
Antiguo 04/01/2002, 19:42
 
Fecha de Ingreso: diciembre-2001
Mensajes: 28
Antigüedad: 22 años, 5 meses
Puntos: 0
Re: Paginar lo paginado

urjose
que ya no te doy la lata ¡¡¡ LO CONSEGUI !!!
Muchas gracias no se que habria hecho sin ti.

¡¡Artista!!

Muchas gracias de verdad me has ahorrado muchos quebraderos de cabeza.

(Ahora, no me preguntes como lo he hecho....¿? )
  #20 (permalink)  
Antiguo 04/01/2002, 19:47
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 22 años, 5 meses
Puntos: 1
Re: Paginar lo paginado

jaja de nada, pero como lo hiciste?

no no te creas que bueno que ya quedo

salu2

y cualquier cosa pues me contactas por mail, messenger, icq

:) ;)

<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">
  #21 (permalink)  
Antiguo 04/01/2002, 19:52
 
Fecha de Ingreso: diciembre-2001
Mensajes: 28
Antigüedad: 22 años, 5 meses
Puntos: 0
Re: Paginar lo paginado

te lo agradezco de corazon porque tengo unas cuantas consultas sobre asp pero.... no se cual es tu email.

De todas formas prometo no ser muy pesada con el tema.

Bueno, de momento esto es todo, me voy a dormir que por aqui es un pelin tarde.

Ciao y gracias de nuevo ;)
  #22 (permalink)  
Antiguo 04/01/2002, 19:59
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 22 años, 5 meses
Puntos: 1
Re: Paginar lo paginado

es [email protected]

salu2

<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">
  #23 (permalink)  
Antiguo 09/10/2003, 17:04
Usuario baneado!
 
Fecha de Ingreso: enero-2003
Mensajes: 184
Antigüedad: 21 años, 4 meses
Puntos: 0
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/cn.asp" -->
<%
Dim Rsm
Dim Rsm_numRows

Set Rsm = Server.CreateObject("ADODB.Recordset")
Rsm.ActiveConnection = MM_cn_STRING
Rsm.Source = "SELECT distinct datediff(m,creation_time, getdate()) as uno, right(convert(char(10), creation_time, 103), 7) as dos FROM table_case ORDER BY datediff(m,creation_time, getdate())"
Rsm.CursorType = 0
Rsm.CursorLocation = 2
Rsm.LockType = 1
Rsm.Open()

Rsm_numRows = 0
%>
<%
select_nivel=request.form("Select_nivel")
response.write "select_nivel" & select_nivel & "<br>"
if select_nivel=0 then
select_nivel=0
else
select_nivel=cint(select_nivel)
end if

id_caso = request.Form("textfield")
if id_caso="" then
id_caso=0
else
id_caso=cint(id_caso)
end if


Dim Rs1
Dim Rs1_numRows

Set Rs1 = Server.CreateObject("ADODB.Recordset")
Rs1.ActiveConnection = MM_cn_STRING
if id_caso>=1 then
Rs1.Source = "SELECT title,convert(Int,table_case.id_number)as id_number FROM dbo.table_case where id_number = " & Cint(id_caso)& " order by id_number"
id_caso=0
else
Rs1.Source = "SELECT title,convert(Int,table_case.id_number)as id_number FROM dbo.table_case where datediff(m,creation_time, getdate()) ="& select_nivel '& " order by id_number"
response.write "SELECT title,convert(Int,table_case.id_number)as id_number FROM dbo.table_case where datediff(m,creation_time, getdate()) ="& select_nivel '& " order by id_number"
end if
'Rs1.Source = "SELECT title, id_number, creation_time FROM dbo.table_case where id_number = " & cint(id_caso)& " order by id_number"
Rs1.CursorType = 0
Rs1.CursorLocation = 2
Rs1.LockType = 1
Rs1.Open()
  #24 (permalink)  
Antiguo 09/10/2003, 17:04
Usuario baneado!
 
Fecha de Ingreso: enero-2003
Mensajes: 184
Antigüedad: 21 años, 4 meses
Puntos: 0
SEGUNDA PARTE


Rs1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = 50
Repeat1__index = 0
Rs1_numRows = Rs1_numRows + Repeat1__numRows
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

Dim Rs1_total
Dim Rs1_first
Dim Rs1_last

' set the record count
Rs1_total = Rs1.RecordCount

' set the number of rows displayed on this page
If (Rs1_numRows < 0) Then
Rs1_numRows = Rs1_total
Elseif (Rs1_numRows = 0) Then
Rs1_numRows = 1
End If

' set the first and last displayed record
Rs1_first = 1
Rs1_last = Rs1_first + Rs1_numRows - 1

' if we have the correct record count, check the other stats
If (Rs1_total <> -1) Then
If (Rs1_first > Rs1_total) Then
Rs1_first = Rs1_total
End If
If (Rs1_last > Rs1_total) Then
Rs1_last = Rs1_total
End If
If (Rs1_numRows > Rs1_total) Then
Rs1_numRows = Rs1_total
End If
End If
%>
<%
Dim MM_paramName
%>
<%
' *** Move To Record and Go To Record: declare variables

Dim MM_rs
Dim MM_rsCount
Dim MM_size
Dim MM_uniqueCol
Dim MM_offset
Dim MM_atTotal
Dim MM_paramIsDefined

Dim MM_param
Dim MM_index

Set MM_rs = Rs1
MM_rsCount = Rs1_total
MM_size = Rs1_numRows
MM_uniqueCol = ""
MM_paramName = ""
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "") Then
MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")
End If
%>
<%
' *** Move To Record: handle 'index' or 'offset' parameter

if (Not MM_paramIsDefined And MM_rsCount <> 0) then

' use index parameter if defined, otherwise use offset parameter
MM_param = Request.QueryString("index")
If (MM_param = "") Then
MM_param = Request.QueryString("offset")
End If
If (MM_param <> "") Then
MM_offset = Int(MM_param)
End If

' if we have a record count, check if we are past the end of the recordset
If (MM_rsCount <> -1) Then
If (MM_offset >= MM_rsCount Or MM_offset = -1) Then ' past end or move last
If ((MM_rsCount Mod MM_size) > 0) Then ' last page not a full repeat region
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If

' move the cursor to the selected record
MM_index = 0
While ((Not MM_rs.EOF) And (MM_index < MM_offset Or MM_offset = -1))
MM_rs.MoveNext
MM_index = MM_index + 1
Wend
If (MM_rs.EOF) Then
MM_offset = MM_index ' set MM_offset to the last possible record
End If

End If
%>
<%
' *** Move To Record: if we dont know the record count, check the display range

If (MM_rsCount = -1) Then

' walk to the end of the display range for this page
MM_index = MM_offset
While (Not MM_rs.EOF And (MM_size < 0 Or MM_index < MM_offset + MM_size))
MM_rs.MoveNext
MM_index = MM_index + 1
Wend

' if we walked off the end of the recordset, set MM_rsCount and MM_size
If (MM_rs.EOF) Then
MM_rsCount = MM_index
If (MM_size < 0 Or MM_size > MM_rsCount) Then
MM_size = MM_rsCount
End If
End If

' if we walked off the end, set the offset based on page size
If (MM_rs.EOF And Not MM_paramIsDefined) Then
If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then
If ((MM_rsCount Mod MM_size) > 0) Then
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If

' reset the cursor to the beginning
If (MM_rs.CursorType > 0) Then
MM_rs.MoveFirst
Else
MM_rs.Requery
End If

' move the cursor to the selected record
MM_index = 0
While (Not MM_rs.EOF And MM_index < MM_offset)
MM_rs.MoveNext
MM_index = MM_index + 1
Wend
End If
%>
<%
' *** Move To Record: update recordset stats

' set the first and last displayed record
Rs1_first = MM_offset + 1
Rs1_last = MM_offset + MM_size

If (MM_rsCount <> -1) Then
If (Rs1_first > MM_rsCount) Then
Rs1_first = MM_rsCount
End If
If (Rs1_last > MM_rsCount) Then
Rs1_last = MM_rsCount
End If
End If

' set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth

Dim MM_removeList
Dim MM_item
Dim MM_nextItem

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If

MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next

' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "") Then
MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<%
' *** Move To Record: set the strings for the first, last, next, and previous links

Dim MM_keepMove
Dim MM_moveParam
Dim MM_moveFirst
Dim MM_moveLast
Dim MM_moveNext
Dim MM_movePrev

Dim MM_urlStr
Dim MM_paramList
Dim MM_paramIndex
Dim MM_nextParam

MM_keepMove = MM_keepBoth
MM_moveParam = "index"

' if the page has a repeated region, remove 'offset' from the maintained parameters
If (MM_size > 1) Then
MM_moveParam = "offset"
If (MM_keepMove <> "") Then
MM_paramList = Split(MM_keepMove, "&")
MM_keepMove = ""
For MM_paramIndex = 0 To UBound(MM_paramList)
MM_nextParam = Left(MM_paramList(MM_paramIndex), InStr(MM_paramList(MM_paramIndex),"=") - 1)
If (StrComp(MM_nextParam,MM_moveParam,1) <> 0) Then
MM_keepMove = MM_keepMove & "&" & MM_paramList(MM_paramIndex)
End If
Next
If (MM_keepMove <> "") Then
MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1)
End If
End If
End If

' set the strings for the move to links
If (MM_keepMove <> "") Then
MM_keepMove = MM_keepMove & "&"
End If

MM_urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "="

MM_moveFirst = MM_urlStr & "0"
MM_moveLast = MM_urlStr & "-1"
MM_moveNext = MM_urlStr & CStr(MM_offset + MM_size)
If (MM_offset - MM_size < 0) Then
MM_movePrev = MM_urlStr & "0"
Else
MM_movePrev = MM_urlStr & CStr(MM_offset - MM_size)
End If
%>
<html>
<head>
</head>
<body>
<p align="center"><font color="#0000FF" size="5">Ordenes de Trabajos </font></p>
<div align="center">
<form name="form1" method="post" action="listado.asp">
<table width="75%" border="1">
<tr>
<td><div align="center">
<p>N&deg; de Caso.
<input type="hidden" name="TipodeBusqueda">
<input type="text" name="textfield">
<input type="submit" value="Buscar">
</p>

<tr>&nbsp;&nbsp;&nbsp;</tr>
Buscar por Fecha
<tr>&nbsp;</tr>
Nivel :

<select name="select_nivel" onChange="javascript:submit();">
<% do while not RsM.eof%>
<option value=<%=RsM(0)%>><%=RsM(1)%></option>
<% RsM.movenext
Loop%>

</SELECT>
<tr>&nbsp;&nbsp;&nbsp;&nbsp;</tr>
<tr> <tr>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tr></div></td>
</tr>
</table>

</form>
<table width="75%" border="1">
<tr>
<td height="25">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<%
While (NOT Rs1.EOF) '((Repeat1__numRows <> 0)) '
%>
<tr>
<td><%=(Rs1.Fields.Item("id_number").Value)%></td>
<td><%=(Rs1.Fields.Item("title").Value)%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Rs1.MoveNext()
Wend
%>
</table>
</div>
<p align="center"><font color="#0000FF" size="5"></font></p>

<table border="0" width="50%" align="center">
<tr>
<td width="23%" align="center"> <% If MM_offset <> 0 Then %>
<a href="<%=MM_moveFirst%>">First</a>
<% End If ' end MM_offset <> 0 %> </td>
<td width="31%" align="center"> <% If MM_offset <> 0 Then %>
<a href="<%=MM_movePrev%>">Previous</a>
<% End If ' end MM_offset <> 0 %> </td>
<td width="23%" align="center"> <% If Not MM_atTotal Then %>
<a href="<%=MM_moveNext%>">Next</a>
<% End If ' end Not MM_atTotal %> </td>
<td width="23%" align="center"> <% If Not MM_atTotal Then %>
<a href="<%=MM_moveLast%>">Last</a>
<% End If ' end Not MM_atTotal %> </td>
</tr>
</table>
<div align="center"> </div>

</body>
</html>
<%
Rsm.Close()
Set Rsm = Nothing
%>
<%
Rs1.Close()
Set Rs1 = Nothing
%>
  #25 (permalink)  
Antiguo 09/10/2003, 17:07
Usuario baneado!
 
Fecha de Ingreso: enero-2003
Mensajes: 184
Antigüedad: 21 años, 4 meses
Puntos: 0
alguen me peude ayudar, ya que la paginacion no me resulta, como los recordset son comunes, se saltan, , ya que pagino por mes, y luego, cuandol e digo que next en el paginador salta hasta el final en vez de a la siguiente pagina paginada, estoy usando el paginador que trae dreamwever6,
que funciona bien pero ahora como el recordset rs1 se engancha y los meses del año van en RsM , se confunden y no me deja moverme bien por los registros al guien me puede ayudar??
  #26 (permalink)  
Antiguo 09/10/2003, 17:07
Usuario baneado!
 
Fecha de Ingreso: enero-2003
Mensajes: 184
Antigüedad: 21 años, 4 meses
Puntos: 0
codigo sin usar paginador del dreamver porlo que es mas entendible, el listbox tira losmeses de enero a diceimbre con lo cual sale un listado para ver los casos (numeros d e orden)

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/cn.asp" -->
<%
Dim Rsm
Dim Rsm_numRows

Set Rsm = Server.CreateObject("ADODB.Recordset")
Rsm.ActiveConnection = MM_cn_STRING
Rsm.Source = "SELECT distinct datediff(m,creation_time, getdate()) as uno, right(convert(char(10), creation_time, 103), 7) as dos FROM table_case ORDER BY datediff(m,creation_time, getdate())"
Rsm.CursorType = 0
Rsm.CursorLocation = 2
Rsm.LockType = 1
Rsm.Open()

Rsm_numRows = 0
%>
<%
Dim Rs1
Dim Rs1_numRows

Set Rs1 = Server.CreateObject("ADODB.Recordset")
Rs1.ActiveConnection = MM_cn_STRING
Rs1.Source = "SELECT title,convert(Int,table_case.id_number)as id_number FROM dbo.table_case order by id_number"
Rs1.CursorType = 0
Rs1.CursorLocation = 2
Rs1.LockType = 1
Rs1.Open()

Rs1_numRows = 0
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="75%" border="1">
<tr>
<td>1111111</td>
<td>22222222</td>
</tr>
<tr>
<td><%=(Rs1.Fields.Item("id_number").Value)%></td>
<td><%=(Rs1.Fields.Item("title").Value)%></td>
</tr>
</table>
</body>
</html>
<%
Rsm.Close()
Set Rsm = Nothing
%>
<%
Rs1.Close()
Set Rs1 = Nothing
%>
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 19:08.