Click to See Complete Forum and Search --> : Database and threads
delbert Harry
April 22nd, 1999, 11:36 AM
I am using a thread to put information into a database, but the app crashes after the first string is entered. So I only get one line into the database. How can I fix this problem of CDaoDatabase object and multithreads. I am using vc4.2
DustinW
April 22nd, 1999, 11:50 AM
My co-workers and I have discovered that DAO, Access, and the Jet DB Engine are not thread safe at all.
I don't know if this could be your problem, but I might I suggest that you need to limit database access to one thread (in one process) at a time.
In other words, don't have tables open in the same MDB in multiple processes, or in multiple threads in the same process at the same time. It was never designed to handle that.
yash
April 22nd, 1999, 03:48 PM
Hi ,
DAO is not thread safe ! but if U have aldreay developed ur appl using DAO n want to avoid much changes now , use mutex or so n see that only one thread opens the DB at a time n close it imm after it is done .
And if U have made this a regular DLL I hope U must have called AfxDaoTerm();
whereever necessary.
Good Luck.
Yash.
sally
April 23rd, 1999, 12:06 AM
There is a brilliant article on this site talking about DAO and threading
take a look at it....
sally
Sally
April 23rd, 1999, 12:06 AM
There is a brilliant article on this site talking about DAO and threading
take a look at it....
sally
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.