Amigo aca va una imagen
http://yfrog.com/jwimagennljla idea es pagina con botones de paginacion ejemplo
Boton Inicio
Boton Atras
Boton Siguente
Boton Fin
FUNCTION paginar_Adelante(oLbx,oRcs,oTabla,oCbx,cIndice)
*--------------------------------------------------------
Local oOrden:=cIndice[oCbx:nAt]
Local campo
If (oRcs:RecordCount) # 0
oRcs:MoveLast()
campo:=oRcs:Fields(oOrden):value
oRcs:Close()
oRcs:Open("SELECT * FROM "+oTabla+" WHERE "+oOrden+" > '" + Alltrim(campo) +"' ORDER BY "+oOrden+" LIMIT 100", oConexion, 1, 3)
If (oRcs:RecordCount) == 0
oRcs:Close()
oRcs:Open("SELECT * FROM "+oTabla+" Order By "+oOrden+" DESC LIMIT 100", oConexion, 1, 3)
oRcs:Sort:=oOrden
Endif
oRcs:Refresh()
oLbx:refresh(.t.)
oLbx:SetFocus()
Endif
RETURN(.t.)
FUNCTION paginar_Atras(oLbx,oRcs,oTabla,oCbx,cIndice)
*-----------------------------------------------------
Local oOrden:=cIndice[oCbx:nAt]
Local campo
If (oRcs:RecordCount)# 0
oRcs:MoveFirst()
campo:=oRcs:Fields(oOrden):value
oRcs:Close()
oRcs:Open("SELECT * FROM "+oTabla+" WHERE "+oOrden+" < '" + AllTrim(campo) +"' ORDER BY "+oOrden+" desc LIMIT 100", oConexion, 1, 3)
If (oRcs:RecordCount) == 0
oRcs:Close()
oRcs:Open("SELECT * FROM "+oTabla+" Order By "+oOrden+" LIMIT 0,100",oConexion, 1, 3)
Endif
If (oRcs:RecordCount) < 100
oRcs:Close()
oRcs:Open("SELECT * FROM "+oTabla+" ORDER BY "+oOrden+" LIMIT 100",oConexion, 1, 3)
Endif
oRcs:Sort:=oOrden
oRcs:Refresh()
oLbx:refresh(.t.)
oLbx:SetFocus()
Endif
RETURN(.t.)
FUNCTION paginar_Inicio(oLbx,oRcs,oTabla,oCbx,cIndice)
*------------------------------------------------------
Local oOrden:=cIndice[oCbx:nAt]
oRcs:Close()
oRcs:Open("SELECT * FROM "+oTabla+" Order By "+oOrden+" LIMIT 0,100",oConexion, 1, 3)
oRcs:Refresh()
oLbx:refresh(.t.)
oLbx:SetFocus()
RETURN(.t.)
FUNCTION paginar_Fin(oLbx,oRcs,oTabla,oCbx,cIndice)
*---------------------------------------------------
Local oOrden:=cIndice[oCbx:nAt]
oRcs:Close()
oRcs:Open("SELECT * FROM "+oTabla+" Order By "+oOrden+" DESC LIMIT 100", oConexion, 1, 3)
oRcs:Sort:=oOrden
oRcs:Refresh()
oLbx:Refresh(.t.)
oLbx:SetFocus()
RETURN(.t.)