
26/06/2002, 14:11
|
 | | | Fecha de Ingreso: noviembre-2001 Ubicación: Vilanova i la Geltrú
Mensajes: 1.942
Antigüedad: 23 años, 5 meses Puntos: 0 | |
una pequeña duda. Tengo el codigo siguien te de paginacion es de WebExperto, pero tengo una duda, donde se pone el nombre de la base de datos?
<%
Dim mostrar
Dim cant_paginas
Dim pagina_actual
Dim registro_mostrado
Dim I
mostrar = 10
If Request.QueryString("page") = "" Then
pagina_actual = 1
Else
pagina_actual = CInt(Request.QueryString("page"))
End If
strsql = "SELECT * FROM tabla"
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open StrConn
Set RS = Server.CreateObject("ADODB.Recordset")
RS.PageSize = mostrar
RS.CacheSize = mostrar
RS.Open strSQL, oConn,3,1
cant_paginas = RS.PageCount
If pagina_actual > cant_paginas Then pagina_actual = cant_paginas
If pagina_actual < 1 Then pagina_actual = 1
If cant_paginas = 0 Then
Response.Write "No hay registros..."
Else
RS.AbsolutePage = pagina_actual
%>
<FONT SIZE="+1">Page <B><%= pagina_actual %></B> of <B><%= cant_paginas %></B></FONT>
<%
Response.Write "<BR><BR>" & vbCrLf
Response.Write "<TABLE BORDER=""1"">" & vbCrLf
Response.Write vbTab & "<TR>" & vbCrLf
For I = 0 To RS.Fields.Count - 1
Response.Write vbTab & vbTab & "<TD><B>"
Response.Write RS.Fields(I).Name
Response.Write "<B></TD>" & vbCrLf
Next 'I
Response.Write vbTab & "</TR>" & vbCrLf
registro_mostrado = 0
Do While registro_mostrado < mostrar And Not RS.EOF
Response.Write vbTab & "<TR>" & vbCrLf
For I = 0 To RS.Fields.Count - 1
Response.Write vbTab & vbTab & "<TD>"
Response.Write RS.Fields(I)
Response.Write "</TD>" & vbCrLf
Next 'I
Response.Write vbTab & "</TR>" & vbCrLf
registro_mostrado = registro_mostrado + 1
RS.MoveNext
Loop
Response.Write "</TABLE>" & vbCrLf
End If
RS.Close
Set RS = Nothing
oConn.Close
Set oConn = Nothing
If pagina_actual > 1 Then
%>
<a href="./paginar.asp?eje=30&page=<%= pagina_actual - 1 %>">[<< Anterior]</a>
<%
End If
For I = 1 To cant_paginas
If I = pagina_actual Then
%>
<%= I %>
<%
Else
...
<p align="center"><img border="0" src="http://www.dacoy.com/images/dacoypro.jpg" width="198" height="57"></p> |