Solved

Add a Progress Bar when i call a PL/SQL with ADO Command

Posted on 2004-09-03
1
459 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
1 Comment
 
LVL 18

Accepted Solution

by:
JR2003 earned 250 total points
ID: 11972346
You could use an animation control instead.
Add an animation control to your form. This is available in "Microsoft Common Controls-2"
Put the required animation on in the application directory. These are availabe in the
C:\Program Files\Microsoft Visual Studio\Common\Graphics\Videos
directory.


'In the form load event
Private Sub Form_Load()
    Animation1.Open App.Path & "\search.avi"



'In the function that calls the stored procedure:
    Animation1.AutoPlay = True
    DoEvents 'Allow the animation to run on a separate thread.

    'Call the stored procedure here
    '...
    '...
    '...

    'Stop the animation control
    Animation1.AutoPlay = False

JR
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

743 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

9 Experts available now in Live!

Get 1:1 Help Now