Opening TOracleDataSet

Jariten

Member
Hi,

I have a TOracleDataSet (for a quick report)
which takes upto 20 seconds to open depending on the value of variables passed in.

Because we don't know how long a query will take to open in advance, we want to open a little progress screen if a query takes more than... say 2 secs to open.

The problem is, after calling dataset.open, the application stops processing messages (from what we can determine) between onbeforeopen and onafteropen. Therefore our timer event doesn't happen until after the query is open and the report is previewing.

Is there a way to effectively process messages while waiting for a TOracleDataSet to open. Should you suggest threads, is it possible to link a report to a dataset in a thread?

Thanks

Alex
 
If most of the time is spent fetching records, you can use the AfterFetchRecord event to show some kind of progress information.

If most of the time is spent executing the query (e.g. because of internal sorts / merges), you will need to open the dataset in a thread and connect it to your report after it is opened. The main thread then has its hands free for other things.

------------------
Marco Kalter
Allround Automations
 
Back
Top