Error Message???

G

Guest

Suddenly my database is giving users the following error message:

The Microsoft Jet database engine stopped the process because you and
another user are attempting to change the same data at the same time. (Error
3197)

This happened to a person who was here over the weekend and was the only one
in the database, and happens when multiple people are in it. This just
started happening in a database we've been using for months.
The Default Open Mode is set to 'shared' and the Default Record Locking is
set to 'no locks'.

I appreciate any help!!!!!!
 
A

Allen Browne

There are many things that can trigger this message.

A common one is where you are using an event to do something which triggers
a chain of events. For example, if you use the KeyDown event of a control to
move to a different record, that will trigger the control's Change event,
BeforeUpdate, AfterUpdate, LostFocus, and Exit events, and then the form's
BeforeUpdate, AfterUpdate, possibly AfterInsert, and Current events, and
then the Enter and Got Focus events of the next control. If anything goes
wrong in that chain, or if any of those events trigger further events (e.g.
if the form's Current event dirties the form) you can get the message.

Another common reason for the problem is a corruption in the VBA code. In an
MDB, Access keeps 2 copies of the code: the text version (what you read and
edit) and the compiled version (what actually executes.) When you change the
form's design, Access creates a backup of the form (so you can revert to the
saved copy), so it is now juggling 4 copies of the code, and sometimes it
gets confused between the copies. A decompile solves this kind of
corruption. To decompile, enter something like this at the command prompt
while Access is not running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

Access 2000 and later have a "feature" called Name AutoCorrect. It's a neat
idea, and the idea is that you can rename a field in the table, and any
queries, forms, or reports will still know how to refer to the field even
though the name changed. In practice, this is badly flawed with dozens of
known bugs, performance penalties of an order of magnitude. It is also the
best way I know to corrupt the database (other than pulling out the power
plug in the middle of a write.) A database corrupted in this way can also
generate this message (amongst many others.) More info:
http://allenbrowne.com/bug-03.html

Bad references can also contribute to this problem.

Suggested sequence:

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact

3. Decompile.

4. Open Access, and compact again.

5. Open a code window.
Choose References from the Tools menu.
Uncheck any references you do not need.
For a list of the ones you typically need in your version of Access, see:
http://allenbrowne.com/ser-38.html

6. Still in the code window, choose Compile from the Debug menu.
Fix any errors, and repeat until it compiles okay.

At this point, you should have a database where the name-autocorrect errors
are gone, the indexes are repaired, inconsistencies between the text- and
compiled-versions of the code are fixed, reference ambiguities are resolved,
and the code syntax is compilable.

If it is still a problem, the next step would be to get Access to rebuild
the database for you. Follow the steps for the first symptom in this
article:
Recovering from Corruption
at:
http://allenbrowne.com/ser-47.html
 
G

Guest

Thank you so much!!!!! I'm trying to follow these steps, on #6, when I hit
'compile' I don't know where to look for the errors if there are any? Once I
hit 'compile', the option to hit it again is gone, it's greyed out?
 
A

Allen Browne

If choosing Compile on the Debug menu in the code window shows no error
messages and the option is then disabled, then your code has compiled
successfully.

You have therefore rebuilt the database. If the problem persists in the new
database, then you have a problem with the code itself, i.e. your algorithm
is flawed at some point.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top