'-----------------------------------
'EXEMPLO BD ADO
'-----------------------------------
With DB.rsTabela
.Close
.Open
.MoveMin
ProgressBar1.Min = 0
ProgressBar1.Max = .RecordCount
Do While Not .EOF
ProgressBar1.Value = .AbsolutePosition
'----------------------------------
'Sua Rotina.....
'----------------------------------
.MoveNext
End If
Loop
End With
////////////////////////////////////////////////////////////////////////////////
'EXEMPLO LENDO ARQUIVO BINARIO, RANDOMICO.....
'--------------------------------------------------------------------
Open "ARQUIVO.TXT" For Binary As #1
BuffersSize = 128
Buffers = Space(BuffersSize)
ProgressBar1.Min = 0
ProgressBar1.Max = LOF(1)
For AQ = 1 To LOF(1) Step BuffersSize
If AQ + BuffersSize > LOF(1) Then Buffers = Space(LOF(1) - AQ)
If Buffers > "" Then
Get #1, AQ, Buffers
'--------------------------------
'SUA ROTINA...
'--------------------------------
End If
ProgressBar1.Value = ProgressBar1.Value + Len(Buffers)
Next AQ
Close #1
Buffers = ""
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''