1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
' dans dataenvironement
Public Function MyExecSQL_(s) As Integer
On Error GoTo eror
If rsExeSQL_.State = 1 Then rsExeSQL_.Close
rsExeSQL_.Source = s
rsExeSQL_.Open
MyExecSQL_ = rsExeSQL_.RecordCount
Exit Function
eror:
MyExecSQL_ = -1
End Function
' dans votre forme
private i as integer
private d as boolean
sub chargement
Dim s As String
With DataEnvironment1
Set DataGrid1.DataSource = Nothing
s = "SELECT * FROM " & Nom_Tabl
progressebar.position:=0
i=0:d=true
timer.eneable:=true
.MyExecSQL_ s
timer1.enable:=false
Set DataGrid1.DataSource = DataEnvironment1
End With
sub timer
' comme on sait pas d'avance le nombre d'enregistrement
if d then
i=i+1
if i>=100 then d=false
else
i=i-1
if i<=0 then d=true
end if
progressebar.position=i
end sub |