MFC/ODBC file corruption problem
Greg Lose -- glose@ArkansasUSA.com Wednesday, December 25, 1996 Environment: VC++ 4.0, Win95/NT3.51 Hello All and Merry Christmas - I have an application written in VC++ 4.0 using ODBC (driver pack 3) that is talking to an Access 7.0 databse. The clients are on Win 95 and the MDB files happen to be sitting on Win NT 3.51. The problem is when multiple people are accessing the DB one of them will suddenly get a message to the effect that the DB is lock by user Admin on Machine XX where XX is sometimes their machine. After this happens every user who attempts to access the DB is given the same message. The only way to fix it is to "repair" the DB. Obviously this doesn't make my users very happy. My questions are - What causes this ? Please be as specific as you can be (pointers to references would be great) What do's/dont's do you know about ODBC & Access that I should be aware of ? Any general tips/techniques you have found usefull. Thanks for your time and I hope I can be of similar use next time ;-) Greg Lose
Avinash Saxena -- avi@outlooksoftware.com Thursday, December 26, 1996 I have used the same configuration in one of my apps -- ODBC+Visual C++. This problem happens when you leave records locked - a record is locked = as soon as you do an Edit(). Also, beware that Access implements page = locking NOT record locking, so if you lock a record on a particular page = in the database, all the records on the same page (I think the page size = is 2K) are locked too. So if your records are pretty small, you can have = several records per page and at a time Access lets you can lock only one = record page. I suggest you check your code to make sure that you call = Update() or CancelUpdate() for every Edit() in your code. Avinash ---------- From: Greg Lose[SMTP:glose@ArkansasUSA.com] Sent: Wednesday, December 25, 1996 3:16 AM To: mfc-l@netcom.com Subject: MFC/ODBC file corruption problem Environment: VC++ 4.0, Win95/NT3.51 Hello All and Merry Christmas - I have an application written in VC++ 4.0 using ODBC (driver pack 3) = that is talking to an Access 7.0 databse. The clients are on Win 95 and the = MDB files happen to be sitting on Win NT 3.51. The problem is when multiple people are accessing the DB one of them will suddenly get a message to = the effect that the DB is lock by user Admin on Machine XX where XX is sometimes their machine. After this happens every user who attempts to access the DB is given the same message. The only way to fix it is to "repair" the DB. Obviously this doesn't make my users very happy. My questions are - What causes this ? Please be as specific as you can be (pointers to references would be great) What do's/dont's do you know about ODBC & Access that I should be aware = of ? Any general tips/techniques you have found usefull. Thanks for your time and I hope I can be of similar use next time ;-) Greg Lose
| Вернуться в корень Архива |