Alguien seria tan amable de facilitarme un ejemplo de Paginacion Con ADo y que muestre los registros en un MSHflexgrid
Gracias de ante mano
Alguien seria tan amable de facilitarme un ejemplo de Paginacion Con ADo y que muestre los registros en un MSHflexgrid
Gracias de ante mano
A ver si te vale este ejemplo:
SaludosCódigo:Private Sub Command1_Click() Dim rs As ADODB.Recordset Dim i As Integer, j As Long Set rs = New ADODB.Recordset ' activar el recordset With rs .ActiveConnection = "Provider=Microsoft.jet.OLEDB.4.0;Data Source=" & _ App.Path & "\MiDB.mdb" .CursorType = adOpenStatic .CursorLocation = adUseClient .Open "Select * from [MiTabla]" End With ' cargar el Grid With MSHFlexGrid1 .FixedCols = 0 ' encabezado .Cols = rs.Fields.Count For i = 0 To rs.Fields.Count - 1 .TextMatrix(0, i) = rs.Fields(i).Name Next .Rows = 1 ' cargar los registros Do While Not rs.EOF .Rows = .Rows + 1 i = .Rows - 1 For j = 0 To rs.Fields.Count - 1 If Not IsNull(rs.Fields(j)) Then .TextMatrix(i, j) = rs.Fields(j) Next rs.MoveNext Loop End With End Sub
Edited by: Anibal