Solved

Using a Progress Bar while Call a Stored Procedure with VB

Posted on 2004-09-03
4
1,238 Views
Last Modified: 2013-12-25
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.
0
Comment
Question by:jorgeani
  • 3
4 Comments
 
LVL 8

Expert Comment

by:mladenovicz
ID: 11971008
You will have to get feedback from command object about progress in order to display progressbar.
0
 
LVL 8

Accepted Solution

by:
mladenovicz earned 250 total points
ID: 11971040
0
 
LVL 8

Expert Comment

by:mladenovicz
ID: 11971045
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 11977936
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.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now