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("nRet orno", adInteger, adParamOutput)
oCmd.Parameters.Append oCmd.CreateParameter("sRet orno", 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.
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",
oCmd.Parameters.Append oCmd.CreateParameter("nRet
oCmd.Parameters.Append oCmd.CreateParameter("sRet
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.
You will have to get feedback from command object about progress in order to display progressbar.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.