Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21090

need help about ADODB Paging

$
0
0
I need help about record paging.

I have some basic codes but not sufficient.

Code:

Dim pCount As Integer
Dim page As Integer

Set rs = New ADODB.Recordset
    rs.CursorLocation = adUseClient
    rs.ActiveConnection = cn
    rs.CursorType = adOpenStatic
    rs.LockType = adLockReadOnly
   
    sql_FILE = "Select * From tblPIC ORDER BY file_ID asc"
    LynxGrid1.Clear
    rs.Open sql_FILE, cn
   
    rs.PageSize = 10
    pCount = rs.PageCount
   
    For page = 1 To rs.PageSize
   
    With LynxGrid1
        .Redraw = False
       
        lRow = .AddItem(rs!File_Name)
            .CellText(lRow, 1) = rs!lastname & ", " & rs!firstname
           
        .Redraw = True
    End With
   
    rs.MoveNext
        If rs.EOF Then Exit For
    Next page
   
Set rs = Nothing


I need to show 10 records each page - already done with it.

how about showing records per page like in ASP.net

example. I want to display this on the bottom of the form "<< 1 2 3 4 5 6 >> "
I dont know to how its done.

when I select "2" or Page "2", next 10 records will be shown on listview or grid.


Any help?

Viewing all articles
Browse latest Browse all 21090

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>