Subject | RE: [IBO] Refresh Screen when executing a large SQL |
---|---|
Author | IBO Support List |
Post date | 2013-01-10T16:52:24Z |
There are two ways to approach this. If it is a query that you have complete
control over and it is a part of a fixed process that can be put fully in
the background then you should use a separate session, connection,
transaction and query and run it in a different thread.
If this is part of an interactive application where the user could be
invoking this and you want them to have the ability to cancel, etc. and you
don't want this to be in a totally separate thread, then you can tap into
the fetch callback mechanisms that allow you to interject the execution of
code between fetches being carried out by the main thread.
I actually need to write some kind of a special document on this whole
subject of fetch callbacks. In short, set the CallbackInc to something 0 or
more and you will have turned on the feature. If you set it to 1 or more you
should get a dialog showing that fetching is taking place after a certain
amount of time. I have it configures so that 4 times a second the stats on
the fetching screen are revised. I just show the count of records in the
buffer. You can tap into the OnCallback (OnFetchCallback?) event to plug in
something more sophisticated if you like. You can set a threshold of time
before a form appears and when the form appears you can perform the count of
records in order to configure a progress bar if that is what you are after.
I think it would be good if I put this feature in one of my sample apps.
Jason
-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of crepodev
Sent: Monday, January 7, 2013 3:53 AM
To: IBObjects@yahoogroups.com
Subject: [IBO] Refresh Screen when executing a large SQL
Hello, i am new in this group, and i need some help.
1 .- How can update, refresh the screen (forms) when is executing a large
SQL that take long time ? ( I tried to put a timer and in his event put an
Application.ProccessMessages every second but it didn't work .
2.- Its posible to show a progressbar when is executing a SQL ?
Thank you.
------------------------------------
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Links
control over and it is a part of a fixed process that can be put fully in
the background then you should use a separate session, connection,
transaction and query and run it in a different thread.
If this is part of an interactive application where the user could be
invoking this and you want them to have the ability to cancel, etc. and you
don't want this to be in a totally separate thread, then you can tap into
the fetch callback mechanisms that allow you to interject the execution of
code between fetches being carried out by the main thread.
I actually need to write some kind of a special document on this whole
subject of fetch callbacks. In short, set the CallbackInc to something 0 or
more and you will have turned on the feature. If you set it to 1 or more you
should get a dialog showing that fetching is taking place after a certain
amount of time. I have it configures so that 4 times a second the stats on
the fetching screen are revised. I just show the count of records in the
buffer. You can tap into the OnCallback (OnFetchCallback?) event to plug in
something more sophisticated if you like. You can set a threshold of time
before a form appears and when the form appears you can perform the count of
records in order to configure a progress bar if that is what you are after.
I think it would be good if I put this feature in one of my sample apps.
Jason
-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of crepodev
Sent: Monday, January 7, 2013 3:53 AM
To: IBObjects@yahoogroups.com
Subject: [IBO] Refresh Screen when executing a large SQL
Hello, i am new in this group, and i need some help.
1 .- How can update, refresh the screen (forms) when is executing a large
SQL that take long time ? ( I tried to put a timer and in his event put an
Application.ProccessMessages every second but it didn't work .
2.- Its posible to show a progressbar when is executing a SQL ?
Thank you.
------------------------------------
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Links