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

[RESOLVED] how to count each value in the database using progress bar

$
0
0
i have a progressbar that loads drom the db
is there a way that the progressbar will count each value in each table?
this is the code that i use
Code:

Set rs = New ADODB.Recordset
    rs.Open "SELECT * FROM Customers", CN, adOpenStatic
    Bar.Max = rs.RecordCount
    Bar.Value = 1
    Label1.Caption = "loading customers"
    LoadCusts

Code:

Private Sub LoadCusts()
  Set rs = CN.Execute("SELECT * FROM Customers ORDER BY ID")
        While Not rs.EOF
            Set itm = FrmCusts.LsVw.ListItems.Add(, , rs!FullName, , "cust")
            itm.Tag = rs!ID
            itm.Bold = True
            itm.SubItems(1) = rs!Address
            itm.SubItems(2) = Format(rs!DateBirth, "dd/mm/yyyy")
            itm.SubItems(3) = rs!Facebook
            itm.SubItems(4) = rs!Email
            itm.SubItems(5) = rs!Phone
            itm.SubItems(6) = rs!Cellular
            itm.SubItems(7) = rs!HairColour
            itm.SubItems(8) = rs!Oxygen
            itm.SubItems(9) = rs!Optional
            rs.MoveNext
        Bar.Value = Bar.Value + 1
     
     
   
  Wend
  DoEvents
End Sub


Viewing all articles
Browse latest Browse all 21273

Trending Articles



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