Very strange mdb corruption issue

K

kiln

A year and half old Access 2000 mdb that is in active development is
crashing Access regularly now, with no error messages. The circumstances
are mind boggling.

To crash the app and Access? Open a form in design mode, change a couple
of font sizes, or write any little bit of code. Save the form and 50%
chande it will crash access. Or it may not, but try to run it and 50%
chance it'll crash. Eventually it will crash Access. Any changes seem to
invoke the failure, at either save or run. Sometimes just opening a
form, either in run or design mode, will crash it. Any form can be the
one you try it with. Nothing but the db window is open in this db
otherwise, no hidden forms etc. Starting with the shift key held down
makes no difference.

It compiles fine. Refs are all good. Latest ver of Access 2000
components. It never crashed like this till late last night. The killer
is, I've gone to backups up to a month old and all exhibit this extreme
fragility. But I worked on this mdb at least every other day for that
entire month, it never crashed. So, something is wrong with my dev pc,
right? Well all of these new and archive copies crash on three other
machines just as quickly, two of which are plain vanilla Access 2000
installs and basically where Access is not used. On a remote pc, it
takes a minute or two to save the form from the db of a month ago after
changing nothing; and it crashes even easier. But that mdb was fine
"back then", why is it so broken now? I'm pulling the month old copies
over onto cds to transport untouched; ie have never been opened on my
dev box, if that's the corrupting agent.

Started with repair and compact; decompile; import into a fresh mdb.
Nothing helped. One import op I noticed a bunch of form modules didn't
make it over (starting from a copy of the file that had crashed). I've
converted it to Access 2003 (as that a2003 type of db) and it didn’t
crash there in testing (yet). Converted that A2003 mdb to a A2000 mdb
and the crashing reappeared immediately. I was hoping that A2003 would
straighten things out a bit...but not when moved back into A2000.

I particularly can't see how mdb's from the last month are apparently
now fouled up, and on widely different pcs, with virgin backup copies.
Too strange!

I have things still to try like chopping out forms one at a time but in
the meantime...know of another uber-fix that I can try?

Thanks
 
A

Allen Browne

You did not mention whether the Name AutoCorrect boxes are turned off under:
Tools | Options | General
If not, that is very likely to create the same corruption repeatedly as you
describe.
After turning it off, compact, decompile, and compact again using Access
2000 (i.e. your original version.)

Is this happening with a particular form? If so, you could try the
undocumented:
SaveAsText acForm, "Form1", "c:\form1.txt"
If that works, you can create a new (blank) database, disable Name
AutoCorrupt, and then:
LoadFromText acForm, "Form1", "c:\form1.txt"

Another option is to copy all the text from the form's module, and save in a
text file. Then set the form's HasModule property to No. Save. Compact.
Test. If the form no longer crashes, you can import it into a new database,
and then paste in the code. If it does crash, you can probably create it
fairly easily, and then paste the code in. (Generally, writing & debugging
your code takes more time than laying out the form.)

If the form has subforms, you will need to handle each of them
independently, i.e. get them working stably before trying to get the main
form to run.

It will be important not to edit with multiple versions of Access (unless
you decompile every time before switching version.) Also, avoid editing the
code in break mode (i.e. End the code, and switch the form to design view
before altering any code in the form's module.)

Some forms can't be rescued no matter what you do. And some subqueries will
crash Access no matter what you do.

Hope there's some useful ideas amongst that.
 
K

kiln

Hi Alan, there are some new items to try in there. Exporting the form to
txt etc is one. AutoNameCorrect is turned off. I'll also try leaving the
mdb decompiled before moving to a2003 and back. The rest of those items
I tried.

The thing that utterly baffles me is that the corruption seems to reach
back at least a month, across unrelated machines. That "just isn't
possible". I've worked on that file very often in the last month. How
could it te possible that I could take an archived, zipped copy from a
month ago, place it on a virgin pc, off the network, and have it blow up
on the first save operation? It's too strange.
 
K

kiln

Still crashes in A2000 after moving into and out of A2003 in decompiled
state.

This has to be the wierdest corruption issue I've ever seen.
 
A

Allen Browne

Any other software installed on this machine recently?

Did the SaveAsText work?
 
K

kiln

Any other software installed on this machine recently?

Did the SaveAsText work?
No new software. What is so blood curdling about this is: every pc I've
tried even month old copies of the software fail almost instantly. I
have many backup copies. Yet, I worked on it most days this last month.
Now all of those older copies are extremely fragile. I've tried 5 pcs
now and all crash the app, even old copies...copies that were in
production. It's really really strange.

The SaveAsText thing is really cool, thanks for that. I wrote a routine
that exported all of the forms off to disk. Then I deleted all of the
forms. Reimported the remaining objects into a new mdb. Used
LoadFromText to rebuild all of the forms. For about ten iterations,
using a delay to slow the pace down (in case that helped) the app would
fail without warning at a different point each time (a different form).
Finally, it pulled all the forms in without crashing. But put a form
into design mode, change one or two formatting elements, save, open the
form, and it blew up.
 
A

Allen Browne

Okay, you've tried a bunch of sensible approaches.

From your description, I have to assume that it is the current editing that
is causing the crash, rather than an incipient corruption that is present in
all your old backups. If this were happening in A2002 or 2003 on forms with
subforms, I would suspect the AccessField bug, but AFAIK, this issue does
not apply to to A2000.

If the crash happens at the time when you switch from design to Form view,
the events likely to contribute at that time would be Form_Open, Form_Load,
Form_Activate, Form_Current, and possibly anything in calculated controls or
in the queries of the form and its subforms. That really doesn't sound very
useful for you though, if this is happening with multiple forms.
 
K

kiln

What is the AccessField bug that you mention applies only to later
versions of Access? Wouldn't likely apply here (wrong ver, in fact I
have not seen it crash when coverted to a2003 format).
 
A

Allen Browne

The bug causes Access 2002 or 2003 to crash (shut down by Windows) in some
cases where the LinkChildFields property of a subform control contains the
name of a field from the subform's RecordSource, not the name of a control
in the subform.

The workaround is to add a text box of the same name to the subform, and
then reassigning the LinkMasterFields and LinkChildFields so Access gets to
associate it with the control.
 

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