Unwanted break mode @ startup Access 2K

A

Allen Browne

This can happen if the project is partially corrupt, and a Decompile should
clear it.

Try this sequence:

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

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

3. Close Access. Make a backup copy of the file. Decompile the database by
entering 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"

4. Open Access, and compact again.
 
K

Kirk Wilson

Every time I start an application I made it goes into break mode at the
same line without an error message. I can F8 through the code until it
ends at which time my main form is displayed. This only happens at start
up and does not happen again. I tried, "clear all break points" with no
effect. I set a breakpoint at the line & then removed it to no avail.
I'm stumped. Any help would be appreciated.
 
K

Kirk Wilson

Hi Allen,

Your fix worked like a charm. Can you explain what was causing this
behavior?

Kirk
 
A

Allen Browne

Access keeps 2 copies of the code:
- the compiled version (the code that actually runs), and
- the text version (as you see and modify it).

If the 2 get out of sync, the database is partially corrupt, and you see
inconsistent behavior such as failing to stop at break points, stopping
where there is no break point, meaningless error messages such as "You or
another user modifed the ...", corrupted text, events that don't work, ...

Decompling tells Access to discard the compiled version. It then recreates
the compiled version from the text version, and so you are back in sync
again.

Regarding what caused the problem, the most likely guess is that you edited
the code in break mode (i.e. while the form is open and running, without
stopping the code and switching to design view.) When you alter the
code/form, Access creates a copy of the object (so you can revert to the
original saved version), so it is now trying to juggle *4* copies of the
code. Under some circumstances, it confuses the many copies, matching and
saving the wrong ones, and so the project is out of sync and corrupt.

Once we realized this issue and stopped editing code in break mode, it cut
out around 75% of the corruptions we were seeing. This was back in the A97
days, but it still applies to the current version, I believe.

The other possible cause is the Name AutoCorrupt "feature" referred to in
the link.
 

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