1,453
社区成员
发帖
与我相关
我的任务
分享Option Explicit
Private Sub Command1_Click()
Timer1.Enabled = True
' ....... '其它代码
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 5000
End Sub
Private Sub Timer1_Timer()
Timer1.Enabled = False
ProgressBar1.Value = (ProgressBar1.Max + ProgressBar1.Min) / 2
DoEvents
End SubOption Explicit
Private WithEvents rs1 As ADODB.Recordset
Private Sub Command1_Click()
...
Set rs1 = New ADODB.Recordset
rs1.Open sql, conn, adOpenKeyset, adLockOpt, adAsyncExecute
End Sub
Private Sub rs1_FetchComplete(ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
ProgressBar1.Value = ProgressBar1.Max
End Sub
Private Sub rs1_FetchProgress(ByVal Progress As Long, ByVal MaxProgress As Long, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
ProgressBar1.Max = MaxProgress
ProgressBar1.Value = Progress
End Sub