posted 23 years ago
If I understand what you are trying to do correctly, it sounds like you are attempting to do it the wrong way around.
You are trying to know how long a query takes before you have run it. Instead, set it up so that it shows a 'please wait' screen then starts the query. Wait till the query finishes then build the results page and replace the 'please wait' page.
The problem with a progress bar if that there is no way to tell when the query is 10%, 50% or 75% complete so it has to be purely time-based, which doesn't work because the query time can depend on things you have no control over.
(this is how I've seen it done in a web app, my preference is to fix the query so that it doesn't take so long)
Dave.