Colegio de Contadores Públicos de Sonora...
<%
dim rs, mydsn,sql
dim cuenta, inicio, final,posicion, brinco, pos1, pos2
dim ligasiguiente, ligaanterior, maximo
brinco=3
mydsn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("/")&"\db\ccps.mdb;Persist Security Info=False"
set rs=server.createobject("adodb.recordset")
sql = "Select * from consejo order by orden"
rs.open sql, mydsn
rs.movefirst()
cuenta=0
while not rs.eof
cuenta=cuenta+1
rs.movenext()
wend
maximo=cuenta/brinco + 1
posicion=int(request("pos"))
if posicion<=0 then
posicion=1
end if
if posicion>int(maximo) then
' response.write "pos=" & cstr(posicion) & " "
' response.write "max=" & cstr(maximo) & " "
posicion = int(maximo)
' response.End()
end if
' response.write maximo
' response.write " "
' response.write int(maximo)
' response.End()
pos1 = posicion * brinco - (brinco-1)
pos2 = posicion * brinco
if posicion*brinco>=cuenta then
ligasiguiente=""
else
ligasiguiente=">>"
end if
if posicion=1 then
ligaanterior=""
else
ligaanterior="<<"
end if
if pos2>cuenta then
pos2=cuenta
end if
rs.movefirst()
%>