I have used the AfxDaoInit() and AfxDaoTerm() in my worker thread to initialize the DAO Jet 3.5 engine.....
But I found if I perfrom some DAO operations in the main thread, and then closing the thread at the same time...
An error will be occured:
Unhandled exception in My.exe(DAO350.dll): 0xC0000005: Access Violation
What is the problem .....how can I use the funciton AfxDaoTerm() when closing the thread???
I found if I haven't used the AfxDaoTerm() function after using the function AfxDaoInit() before opening the database, an error will also be occured. What can I do?
I know if I don't use any recordset object in my thread..no error will be occured. when I close the thread. However, I really need to access one database in my main thread and use a worker thread to access another also..
Thanks for your opinion!!!