Dave Page wrote:
>The one architectural change I can think of is to make Andreas' query
>engine and grid into a simple control that we can place on a form and
>pass a query to, and then to do exactly that with his query tool, and
>the QB.
>
Querying code is extracted to a wxListView derived ctlSQLResult class.
Most of remaining frmQuery::executeQuery() code deals with status
information, insuring updated display (wxYield) and performance
optimization (Freeze/Thaw).
Basically, it's:
ctl->Execute();
while (ctl->RunningStatus() == CTLSQL_RUNNING)
do other stuff or take a nap;
if (ctl->RunningStatus() == PGRES_TUPLES_OK)
while (stillDataAvail)
{
chunksize=100;
rowsReadThisTurn=ctl->Retrieve(chunksize);
}
msg=ctl->GetMessages(); // show in messages window
errmsg=ctl->GetErrorMessages(); // put in status line
>I don't know if you've tried it, but his code is lightning fast.
>
>
Thanks for the bunch of flowers! :-)
Regards,
Andreas