At 2:49 PM -0400 15/6/06, Nate Smith wrote:
I am writing an application in which I am querying a SQL Server database
via ODBC.  After querying the database, I use a Do...Until loop to iterate
over the recordset and fill a listbox with rows of data.  This query takes
quite some time to run, and I want to show the user some visual feedback; a
progress wheel.  However, my interface just freezes and the progress wheel
never displays.  In fact, the interface does not unfreeze until the listbox
is fully populated.

So, I tried putting the query and the recordset loop inside a thread.  This
did not change anything.

I also tried (without the thread) using app.DoEvents.  Still no luck.

Does anyone have any suggestions?


As Norman says you can't do much during the >SQLselect call but you can do somehting when you are populating the listbox.
I use this pseudo-code quite a bit....

...
            ListBox1.AddRow rc.IdxField(1).stringvalue
            cnt = cnt + 1
            if cnt mod 100 = 0 then
                ProgressBar1.Value = cnt
                ProgressBar1.Refresh //force a refresh
            end
....
--

Cheers,

Dr Gerard Hammond
Bioinformatic Analyst
Garvan Institute of Medical Research, Sydney, Australia.

PowerPC Mac the world's most advanced obsolete computer.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to