Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to cancel a query with MS Access

51 views
Skip to first unread message

Nils

unread,
Apr 10, 2001, 8:05:23 AM4/10/01
to

Is it possible to cancel/abort a time consuming query against an MS
Access database?

I have a large database (100k to 1M records) against which a allow the
user specify a query. The problem is that the user may specify a query
that takes a long time and a lot or resources to perform. Hence I need
to allow the user to cancel that query.

The application uses ODBC through CRecordset and CDatabase. It
retrieves data from different ODBC compliant databases, including
Access.

The documentation states that asynchronous mode for ODBC is no longer
supported by the MFC ODBC classes because threads should be used
instead. But this doesn't really help since the thread executing the
slow Open/Requery will get stuck and still use resources for running
the query.

I have experimeneted with the MTDB example that comes with Develper
Studio. There CRecordset::Cancel is called bute this causes the
application to hang in SQLCancel. I also tied to call
CDatabase::SetQueryTimeou but this had no effect.t

Is there any way to solve this problem?

Would using DAO or ADO be any better (for this particular problem)?

Thanks,
Nils

0 new messages