DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How to make a status of progress bar while loading a recordset

  1. #1
    Robin Guest

    How to make a status of progress bar while loading a recordset



    Hi

    How to make a status of progress bar while loading a recordset that I just
    opened?

    I made the first query to get a count of records then I used the second query
    to retieve the data. I noticed it took one minute to pass the open statement
    before populating the listview. so I like to add a progress bar for this
    second query to tell users that it is still running the query.

    Is there any breakdown of this statement so I can make a progess bar?


    rstResult.Open Gbl_query, strCnn, , , adCmdText


    Your help will be greatly appreciated.
    Thanks in advance




  2. #2
    Steve Guest

    Re: How to make a status of progress bar while loading a recordset


    One way is to load the recordset asynchronously, and trap the events raised
    by the recordset as it is loading. However, to pull this off, your classes
    need to each use a module level recordset declared WithEvents. In the ADO
    help file, do a search on the FetchProgress and FetchComplete events attached
    to the Recordset object. They should outline what you need to do when you
    open the recordset (I believe it is just one option setting) and then you
    can get a progress as the RS is loading. Also take into account that this
    is performed asynchronously, so you will need to change your program logic
    a bit. Code that:

    Setup RS
    Open RS
    Read Data from RS

    needs to change so that the Reading and processing is performed after ther
    FetchComplete event fires. There are a few options for that, but noodle over
    it a bit and see if it suits your needs.

    Steve.

    "Robin" <ice1guy@aol.com> wrote:
    >
    >
    >Hi
    >
    >How to make a status of progress bar while loading a recordset that I just
    >opened?
    >
    >I made the first query to get a count of records then I used the second

    query
    >to retieve the data. I noticed it took one minute to pass the open statement
    >before populating the listview. so I like to add a progress bar for this
    >second query to tell users that it is still running the query.
    >
    >Is there any breakdown of this statement so I can make a progess bar?
    >
    >
    >rstResult.Open Gbl_query, strCnn, , , adCmdText
    >
    >
    >Your help will be greatly appreciated.
    >Thanks in advance
    >
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center