Link to home
Start Free TrialLog in
Avatar of jorgeani
jorgeani

asked on

Using a Progress Bar while Call a Stored Procedure with VB

Hi i Have a question.... How can i add a progress bar while my VB code call a Stored Procedure?
I have this code:

        Dim oCon As Connection
        Dim oCmd As Command
        Set oCmd.ActiveConnection = oCon
        oCmd.CommandType = adCmdStoredProc
        nRetorno = 0
        oCmd.Parameters.Append oCmd.CreateParameter("n1", adInteger, adParamInput, len(value), value)
        oCmd.Parameters.Append oCmd.CreateParameter("nRetorno", adInteger, adParamOutput)
        oCmd.Parameters.Append oCmd.CreateParameter("sRetorno", adVarChar, adParamOutput, 200)
        oCmd.CommandTimeout = 10000
        DoEvents
        oCmd.Execute
        nRetorno = oCmd.Parameters("nRetorno").
       ... etc.


I ask that because when VB execute this command Line oCmd.Execute the screen waits until the Stored Procedure finish, and the user can´t wait around 10 minutes for example while the PL/SQL process 1 million of records. And for this reason i want to add a Progress Bar, but i don´t know how can i add  this control is this code.

Thanks a lot.
Avatar of mladenovicz
mladenovicz

You will have to get feedback from command object about progress in order to display progressbar.
ASKER CERTIFIED SOLUTION
Avatar of mladenovicz
mladenovicz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Anthony Perkins
The simple answer is that you cannot give a realistic progress bar.  The very best you can do is make it asynchronous and enable a button to cancel the execution.