PRB: DAO 3.0 Must Be Used in Primary ThreadLast reviewed: February 12, 1998Article ID: Q151407 |
The information in this article applies to:
SYMPTOMSAttempting to use either the MFC DAO classes or the DAO SDK dbDao classes in any thread but the primary one causes unexpected behavior.
CAUSEDAO 3.0 is not marked as apartment-model or free-threaded in the registry. No multithreading testing has been done on DAO 3.0. Any documentation should say that DAO 3.0 is not thread-safe and should only be used in the primary thread in a process.
RESOLUTIONDo not use MFC DAO or the DAO SDK dbDao classes in any thread but the primary thread of an application.
STATUSThis behavior is by design.
MORE INFORMATIONInternally, the Jet engine is multithreaded, and the registry setting \HKEY_LOCALMACHINE\Software\Microsoft\Jet\3.0\Engines\Jet\Threads controls the number of threads that the engine uses internally. The Jet engine is multithreaded internally, but neither DAO nor the Jet engine are thread- safe. For more information on OLE threading models, see the following article in the Microsoft Knowledge Base:
ARTICLE_ID: Q150777 TITLE : Descriptions and Workings of OLE Threading ModelsTech Note #64: Apartment-Model Threading in OLE Controls
REFERENCESARTICLE_ID: Q147629 TITLE : PRB: Problems if ODBC or DAO in DLL's InitInstance or DLLMain Keywords : dbDao MfcDAO kbprg kbusage Technology : kbMfc Version : 4.0 4.1 4.2 Platform : NT WINDOWS Issue type : kbprb |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |