acá te paso algo quer encontré por ahí y le hice un par de modificaciones, para probarlo deberías cambiar la cadena de conexión (está puesta para SQL Server) y el nombre de la tabla en el SELECT:
<%
Dim pag, iEstado
Dim oConn, SQL, rs
Dim aDatos, iTotal
Dim I, J, strNombres
set oConn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.Recordset")
oConn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=usuario;Initial Catalog=operacion;Data Source=srvdatos;Password=pwd"
SQL="SELECT * FROM EQ013 (nolock)"
rs.CursorType = 0
rs.LockType = 1
rs.CursorLocation = 3
rs.Open SQL, oConn
aDatos = rs.GetRows
For i = 0 To Rs.Fields.Count - 1
strNombres = strNombres & Rs(i).Name & ","
Next
strNombres = Left(strNombres, Len(strNombres) - 1) 'le saco la ultima coma
rs.Close
oConn.Close
set rs = nothing
set oConn = nothing
pag = CInt(Request.QueryString("P"))
iEstado = PaginarGR (10, pag, aDatos, strNombres)
'**************************************************
Function PaginarGR (iRegsPorPag, iPag, vector, headers)
Dim I, J
Dim iPaginas, iPagActual
Dim iTotal, iComienzo, iFin, aNombres
iTotal = UBound(aDatos,2) + 1
iPaginas = (iTotal \ iRegsPorPag)
if iTotal mod iRegsPorPag > 0 then
iPaginas = iPaginas + 1
end if
if iPag < 1 then
iPag = 1
end if
if iPag > iPaginas then
iPag = iPaginas
end if
Response.Write("Página " & iPag & " de " & iPaginas & " (" & iTotal & " registros)<br>")
iComienzo = (iPag-1) * iRegsPorPag
iFin = iComienzo + (iRegsPorPag - 1)
if iFin > UBound(vector, 2) then
iFin = UBound(vector, 2)
end if%>
<%'Pinto la tabla
Response.Write("<TABLE BORDER=""1"">")
aNombres = Split(headers, ",")
for I= 0 to Ubound(aNombres)
Response.Write("<TD>" & aNombres(I) & "</TD>")
next
for I= iComienzo to iFin
Response.Write("<TR>")
for J=0 to UBound(vector,1)
Response.Write("<TD>" & vector(J,I) & "</TD>")
next
next
Response.Write("</TABLE><br><br>")
'Imprimo enlaces, si son necesarios
if iPag > 1 then
Response.Write("<A HREF=""grpaginar.asp?P="&iPag-1&"""><b>Anterior</b></A> ")
end if
if iPag < iPaginas then
Response.Write("<A HREF=""grpaginar.asp?P="&iPag+1&"""><b>Siguiente</b></A> ")
end if
PaginarGR = 0
End Function
'=====================================================================================
%>
|