<%
'paginado
cantidadregistros=2
If request.QueryString("paginaactual")<>"" then
mostrarpagina=request.QueryString("paginaactual")
else
mostrarpagina=1
end if
'fin
dim cnn1,RS1
Set cnn1 = server.createobject("adodb.connection")
cnn1.Open "PROVIDER=Microsoft.jet.OLEDB.4.0; DATA SOURCE="&Server.MapPath("../Administracion_Servicios/articulos.mdb")
busqueda="SELECT * FROM servicios WHERE promocion"
Set RS1 = server.CreateObject("ADODB.Recordset")
'paginado
RS1.cachesize=60
'fin
RS1.Open busqueda,cnn1,3,1
If RS1.recordcount<>0 then
'paginado
RS1.pagesize=cantidadregistros
maxpagina=cint(RS1.pagecount)
maxregistros=cint(RS1.pagesize)
RS1.Absolutepage=mostrarpagina
contreg=0
if cint(mostrarpagina)<>int(maxpagina) then
hasta=mmostrarpagina*5
desde=hasta-4
else
hasta=RS1.recordcount
desde=(maxpagina*5)-4
end if
'fin
DO WHILE not RS1.EOF and contreg < maxregistros
Recid =RS1("cod")
nombre = RS1("nombre")
direccion = RS1("direccion")
seccion = RS1("seccion")
caracteristicas = RS1("caracteristicas")
%>
<%if RS1("img")<>"" then %>
<%
Dim foto1
foto1= "../Administracion_servicios/upload/" & RS1("img")
%>
<%else
Dim sinfoto
sinfoto="../img/sinfoto.jpg"
%>
<%end if%>
<% if contreg=1 then %>
<% end if%>
<%=nombre%>
Sección:
<%=seccion%>
Dirección:
<%=direccion%>
<%=caracteristicas%>
<%
RS1.movenext
contreg=contreg+1
loop %>
<%
'cerramos el recordset e liberamos a memória usada
RS1.close
set RS1=nothing
cnn1.close
set cnn1=nothing
'final resultados de la busqueda
'response.Write("")
%>
<%
cero="0"
nombrescript=request.servervariables("script_name")
if int(mostrarpagina)<>1 then '--si no es la primer página mostrar botón atrás
ref="[<< Anterior] "
end if
for contador=1 to maxpagina
If contador>9 then
cero=""
end if
ref=ref & " " & cero & contador & ""
else
ref=ref & "'>" & cero & contador & ""
end if
next
if int(mostrarpagina)<>int(maxpagina) then '-- si no es la última página
' mostrar botón siguiente
ref=ref & " [Siguiente >>]"
end if
'response.write ref
%>