Long queries and progress or SOMETHING...Geezzzzz...Can SOMEONE help me out here 
Author Message
 Long queries and progress or SOMETHING...Geezzzzz...Can SOMEONE help me out here

I am coding a DB app in delphi 3 (currently hitting local .dbf tables
... but eventually this will get ported to an InterBase and/or MS SQL
7.0 back end) Anyway, one of the queries does an update on a few
tables and some of these take some time. As a result, I want to be
able to update the screen with SOMETHING that tells the user that the
application is actually DOING SOMETHING and NOT to shut it off!

Ok, venting aside now, I tried writing a Callback function that would
update a progressbar or TLabel.Caption (depending on the callback
values in the recordtype)  and the call an
Application.ProcessMessages. I tried this code on a TBatchMove
component and things worked fine but on the TQuery control I get
ZIP...

Is there a way to use SOME type of function call to allow the
application to gain control of itself (even if it's to do nothing more
than repaint itself)?

Any help is GRATIOUSLY appreciated!

TIA,

Bill
-----
Bill Artemik
Programmer / Analyst
Droste Consultants, Inc.



Wed, 18 Jun 1902 08:00:00 GMT  
 Long queries and progress or SOMETHING...Geezzzzz...Can SOMEONE help me out here
If your update is done with _one_ single SQL statement, then a progress
bar is not possible (maybe it is possible with some databases (?)).  You
could however put up a message indicating a possibly long running process
has been started.
The feature is sorely missed by many ...

Aage J.

Quote:

> I am coding a DB app in Delphi 3 (currently hitting local .dbf tables
> ... but eventually this will get ported to an InterBase and/or MS SQL
> 7.0 back end) Anyway, one of the queries does an update on a few
> tables and some of these take some time. As a result, I want to be
> able to update the screen with SOMETHING that tells the user that the
> application is actually DOING SOMETHING and NOT to shut it off!

> Ok, venting aside now, I tried writing a Callback function that would
> update a progressbar or TLabel.Caption (depending on the callback
> values in the recordtype)  and the call an
> Application.ProcessMessages. I tried this code on a TBatchMove
> component and things worked fine but on the TQuery control I get
> ZIP...

> Is there a way to use SOME type of function call to allow the
> application to gain control of itself (even if it's to do nothing more
> than repaint itself)?

> Any help is GRATIOUSLY appreciated!

> TIA,

> Bill
> -----
> Bill Artemik
> Programmer / Analyst
> Droste Consultants, Inc.




Wed, 18 Jun 1902 08:00:00 GMT  
 Long queries and progress or SOMETHING...Geezzzzz...Can SOMEONE help me out here

Quote:

> If your update is done with _one_ single SQL statement, then a progress
> bar is not possible (maybe it is possible with some databases (?)).  You
> could however put up a message indicating a possibly long running process
> has been started.
> The feature is sorely missed by many ...

The Sybase SQL-server has a callback function that make this possible.


Wed, 18 Jun 1902 08:00:00 GMT  
 Long queries and progress or SOMETHING...Geezzzzz...Can SOMEONE help me out here

Quote:

> I am coding a DB app in Delphi 3 (currently hitting local .dbf tables
> ... but eventually this will get ported to an InterBase and/or MS SQL
> 7.0 back end) Anyway, one of the queries does an update on a few
> tables and some of these take some time. As a result, I want to be
> able to update the screen with SOMETHING that tells the user that the
> application is actually DOING SOMETHING and NOT to shut it off!

> Ok, venting aside now, I tried writing a Callback function that would
> update a progressbar or TLabel.Caption (depending on the callback
> values in the recordtype)  and the call an
> Application.ProcessMessages. I tried this code on a TBatchMove
> component and things worked fine but on the TQuery control I get
> ZIP...

> Is there a way to use SOME type of function call to allow the
> application to gain control of itself (even if it's to do nothing more
> than repaint itself)?

> Any help is GRATIOUSLY appreciated!

Why don't you use a TAnimate ? Like :

  DBProgressAnimated.Active := True;
  qryUpdata.ExecSQL;
  DBProgressAnimated.Active := False;

Eventually, if you want to do it really nice, you create a modal dialog
(or form), write an execute-procedure where you pass the SQL-string to
the modal dialog (or form), starts the animation on the form, execute
the query et voila :-)



Wed, 18 Jun 1902 08:00:00 GMT  
 Long queries and progress or SOMETHING...Geezzzzz...Can SOMEONE help me out here
Hi Bill,

I would like to know if you can do whatever it is you would like in a
seperate thread, and then get the thread to update a progress bar, and place
it on some position on your form or something.

procedure TForm1.Button1Click(Sender: TObject);
var
   ExecuteThread : TMyThread;
begin
   ExecuteThread:= TMyThread.Create(True);
   ProgressBar1.Min := 0;
   ProgressBar1.Max := 1000000;
   ExecuteThread.Execute;
end;

I am sure that if you play around with it you will find a solution.

Please tell me if this helps.

Quote:

>I am coding a DB app in Delphi 3 (currently hitting local .dbf tables
>... but eventually this will get ported to an InterBase and/or MS SQL
>7.0 back end) Anyway, one of the queries does an update on a few
>tables and some of these take some time. As a result, I want to be
>able to update the screen with SOMETHING that tells the user that the
>application is actually DOING SOMETHING and NOT to shut it off!

>Ok, venting aside now, I tried writing a Callback function that would
>update a progressbar or TLabel.Caption (depending on the callback
>values in the recordtype)  and the call an
>Application.ProcessMessages. I tried this code on a TBatchMove
>component and things worked fine but on the TQuery control I get
>ZIP...

>Is there a way to use SOME type of function call to allow the
>application to gain control of itself (even if it's to do nothing more
>than repaint itself)?

>Any help is GRATIOUSLY appreciated!

>TIA,

>Bill
>-----
>Bill Artemik
>Programmer / Analyst
>Droste Consultants, Inc.




Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Progress of a long query

2. how to make multiple read outs - help

3. Help with long strings as query parameters

4. Help w/ long query

5. Query progress

6. Monitoring Query Progress / termination

7. HOW TO SHOW THE PROGRESS OF A QUERY??

8. Query Progress

9. Query Progress bar for MSSQL

10. Progress message during query execution?

11. Q: [IDAPI] Query Progress CallBack Function

12. Query progress bar?

 

 
Powered by phpBB® Forum Software