Solved

Progress Bar + SQL

Posted on 2002-07-18
4
158 Views
Last Modified: 2010-05-02
I am trying to have a status bar that monitors sql queries.  However, I'm not quite sure how the code would work for the start of the query and end.

Any suggestions would be great....

0
Comment
Question by:baddogi
  • 2
4 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 100 total points
ID: 7162404
The only way you can achieve anything of this sort is to have your query run asynchronously. To do this you need to do this following:

Use ADO
Declare the recordset/connection using WithEvents
Set the recordset cursorlocation to adUseClient
Use the Recordset_Progress event (or equivalent) to determine the number of records retrieved.

This however cannot tell you ahead of time how many records in total will be retrieved so the best that you can do is estimate this and adjust your progress bar maximum dynamically as records are retrieved.
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 7162422
No comment and a 'C' grade, I would perhaps have preferred you to wait for some other opinion before accepting with a 'C'.
0
 

Author Comment

by:baddogi
ID: 7162427
Well, it wasn't all too clear and am in kind of a hurry with this.

Sorry I offended you!
0
 

Expert Comment

by:ComTech
ID: 7162717
This grade can and will be changed, thanks to all.

Regards,

ComTech
Community Support Administrator  
Experts-Exchange  
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

758 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

20 Experts available now in Live!

Get 1:1 Help Now