Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/59.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
vb6如何在sql查询(mysql)中添加进度条_Mysql_Vb6 - Fatal编程技术网

vb6如何在sql查询(mysql)中添加进度条

vb6如何在sql查询(mysql)中添加进度条,mysql,vb6,Mysql,Vb6,我在表单中有以下代码,每当查询仍在执行时就会挂起表单: 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(C

我在表单中有以下代码,每当查询仍在执行时就会挂起表单:

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
如何向其添加进度条


谢谢

MySQL不会告诉你一个查询离完成有多近,它只能告诉你它已经运行了多长时间,或者是什么阻碍了进程,就像其他查询阻止了它一样


如果您有一个长时间运行的查询,您需要猜测计算ETA需要多长时间。

谢谢!DoEvents也没有。