0
我有一個表格下面的代碼,掛起,每當查詢仍在執行的形式:VB6,如何添加進度條上的SQL查詢(MySQL的)
Public Function OpenRS(strSql As String) As ADODB.Recordset
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.CursorType = adOpenDynamic
If IsNull(Cn) = False Then
rs.Open strSql, Cn, adOpenKeyset, adLockPessimistic ', adAsyncExecute
End If
Set OpenRS = rs
End Function
嘗試添加adAsyncExecute但窗體關閉。
Dim RSC As ADODB.Recordset
Set RSC = Nothing
Set RSC = Cn.Execute("CALL SP_Rank_by_Company('" & MyDate1 & "','" & MyDate2 & "','DELETE')", , adAsyncExecute)
While Cn.State = 4
If frmLoadingReports.picLoading.Width = 5320 Then
frmLoadingReports.picLoading.Width = 0
Else
frmLoadingReports.picLoading.Width = frmLoadingReports.picLoading.Width + 100
End If
'count total records
'get the current number of records processed
DoEvents
Wend
如何添加進度條?
謝謝!
謝謝! DoEvents不會。 –