Click here to Skip to main content
13,199,311 members (68,288 online)
Click here to Skip to main content
Add your own
alternative version


19 bookmarked
Posted 3 Sep 2002

MTDaoRecordset : A DAO Class that supports MultiThreading

, 4 Sep 2002
Rate this:
Please Sign up or sign in to vote.
If you're sufferring from dao cracks in multithreaded environment, this article will be useful to you
<!-- Download Links --> <!-- Add the rest of your HTML here -->


CMTDaoDatabase is derived from CDaoDatabase and has a static CCriticalSection member variable. And CMTDaoRecordset is derived from CDaoRecordset. All calls to CDaoDatabase and CDaoRecordset public member functions is serialized by the static member variable of CMTDaoDatabase, so you can use these classes in a multithreaded enviroment.


To use CMTDaoDatabase, just replace CDaoDatabase with CMTDaoDatabase. You can create your own recordset classes with VC ClassWizard, and then replace all occurences of CDaoRecordset with CMTDaoRecordset in your source files of derived classes. You can also defined CMTDaoRecordset objects and use them as CDaoRecordset objects. And I am sure that there won't be any deadlock problem bothering you. Bug reports and revisions are welcomed, thanks.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Kevin Hua
Web Developer
China China
No Biography provided

You may also be interested in...


Comments and Discussions

GeneralOpening DB/Recordset fails Pin
Akif15-Feb-04 17:57
memberAkif15-Feb-04 17:57 
GeneralRe: Opening DB/Recordset fails Pin
eo12112-Jun-08 10:49
membereo12112-Jun-08 10:49 
GeneralDAO is enough for my work Pin
Kevin Hua5-Sep-02 17:03
sussKevin Hua5-Sep-02 17:03 
Generalor... Pin
Anonymous4-Sep-02 20:18
sussAnonymous4-Sep-02 20:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.171020.1 | Last Updated 5 Sep 2002
Article Copyright 2002 by Kevin Hua
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid