Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/11/2013, 04:32
xclapes
 
Fecha de Ingreso: noviembre-2013
Mensajes: 13
Antigüedad: 10 años, 5 meses
Puntos: 0
Ajuda en código paginacion ASP

Hola a todos,

He realizado el siguiente código para que que realice una consulta a una base de datos Acces y que muestre un listado de todos los registros con una paginación.

Cuando ejecuto en el navegador la página ASP me da el siguiente error:

**********************
Tipo de error:
ADODB.Recordset (0x800A0CB3)
El recordset actual no admite marcadores. Puede deberse a una limitación del proveedor o del tipo de cursor seleccionado.
/novasp/llistatpaginacion.asp, línea 59
**********************
No hay manera de hacer funcionar esta sencilla página, no se si es problema de incompatibilidad o si me falta alguna cosa.

El código es el siguiente:
********************
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
Dim conex
Dim RS
Dim pagina
Dim cont %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin t&iacute;tulo</title>
</head>
<body>
<%
SET conex=server.CreateObject ("ADODB.Connection")
SET RS=server.CreateObject("ADODB.Recordset")

Conex.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:\Inetpub\wwwroot\novasp\agenda.mdb "
RS.Open "agenda", conex
If RS.EOF THEN
response.Write "no existe"
Else
xx=rs.PageCount
response.Write(xx)
RS.PageSize=3
pagina=request.QueryString("pagina")

If pagina=""then pagina = 1 else pagina =CInt(pagina)
'%>
<table border="1" ALIGN="CENTER">
<tr>
<td align="center">
<% If pagina > 1 then %>
' <A HREF="llistatpaginacion.asp?pagina=<%=pagina -1 %>">
&lt;&lt; Anterior </A>
<% End if %>
</td>
<td align="center">
pagina <% = pagina %> de <% =RS.PageCount %>
</td>
<td align="center">
<% If pagina<RS.PageCount THEN%>
<A href="llistatpaginacion.asp?pagina=<% =pagina +1 %>"> Siguiente &gt;&gt;
</A>
<% End if %>
</td>
</tr>

<tr>
<th> nombre</th>
<th> apellidos </th>
<th> telefono </th>
</tr>
<%

RS.AbsolutePage=pagina
Cont=0
DO WHILE NOT RS.Eof
Cont=Cont+1
If Cont>RS.PageSize THEN Exit DO
%>
<tr>
<td><%=RS("nombre") %> </td>
<td><%=RS("apellidos") %> </td>
<td><%=RS("telefono") %> </td>
</tr>
<%
RS.MoveNext
LOOP
%>
</table>
<%
END IF
RS.Close
conex.Close
SET RF=Nothing
SET conex=Nothing
%>
</center>
</body>
</html>