请问多线程中能否使用DAO。
我现在要在自己开的线程中使用DAO来查询ACCESS数据库。
MSDN中说不建议才多线程中使用DAO,即使使用也应在主线程中。
请问高手是否可以使?
不能使有无好的办法,因为现在程序已经写好,改太麻烦。

解决方案 »

  1.   

    DAO是现成安全的,不过建议使用ADO,或者OLE DB
    ============================================================================
    http://www.betajin.com/alphasun/index.htm           给我发信息请附带原帖地址
    http://alphasun.18en.com/                    http://shakingtoolkit.9126.com/
    DocWizard C++程序文档自动生成工具 | Wave OpenGL | HttpProxy | AjaxParser词法分析
      

  2.   

    Unfortunately, there's no safe way of accomplishing what you want.
    because DAO is not Thread-safe.
    There are several KB articles that will interest you:
    Q156138 "Limitations of DAO, DAO SDK in NT Service or with Threads".
    Q169395 "PRB: Thread Safety for DAO/Jet 3.5"
    Q151407 "PRB: DAO 3.0 Must Be Used in Primary Thread"