Access 2007 Object Corruption

  • Thread starter CrazyAccessProgrammer
  • Start date
C

CrazyAccessProgrammer

Have been using Access since Access 97. Been programming with Access 2007 now
for about a month. It's very dissappointing how often objects become corrupt.
I seem to spend more time fixing object corruption than anything else. Hope a
future patch of Access can calm this down at least a bit.
 
A

Allen Browne

Can you pin down:
a) the kinds of corruption you are experience, and
b) the situations where this arises.

It is when modifying forms/reports? Or only when modifying data (e.g. in an
MDE where the objects themselves cannot be modified)?

Are there any consistent factors: subforms? Editing while the code window is
in break mode? Databases converted from a previous version?

What about the usual things? Name AutoCorrect off? SP1 applied? Decompile
tried?

Guidelines for avoiding corruption (not specific to A2007):
http://allenbrowne.com/ser-25.html

Guidelines for uncorrupting a database:
http://allenbrowne.com/recover.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

"CrazyAccessProgrammer" <[email protected]>
wrote in message
news:[email protected]...
 
A

a a r o n _ k e m p f

Jet corrupts all the time. It's a fact and that is why Jet has been
obsolete for the past decade.

Upsize to SQL Server if you want to maintain _ANY_ uptime.

-Aaron
 
C

CrazyAccessProgrammer

"Can you pin down the kinds of corruption you are experience"

I'm unable to determine where the corruption is. I try copying in backup
objects (tables, forms, modules etc.) from a known 'good' backup of my
database to the one I'm working on that is experiencing corruption, but
always without luck. In the end, I have to go back to my last 'good' backup
of my database and redo whatever work I had done since that 'good' copy...
all the while hoping I don't corrupt yet again.
"Can you pin down the situations where this arises"

Usually after a runtime error of my VBA code. Though there is no rhyme or
reason to it. It doesn't seem to matter if the code that errored out was
doing something complex or something simple. Or if the error was caused by a
complex number of processes erroring out during the middle of its execution
or by a simple syntax error.
"Is It when modifying forms/reports? Or only when modifying data (e.g. in an MDE >where the objects themselves cannot be modified)?"

The corruption is happening with a form I've been working and coding on. I
am NOT currently working on the database in MDE form.
"Are there any consistent factors: subforms?"

No subforms are involved in the form I'm working on at this point.
"Are there any consistent factors: Editing while the code window is
in break mode?"

Yes, I am guilty of this. But I do this rarely and it doesn't account for
the vast majority of times I end up with a corrupted database.
"Are there any consistent factors: Databases converted from a previous version?"

The database I'm working on is a brand new database started from scratch
using Access 2007, fully patched as of this writing.
"Are there any consistent factors?"
Right now I'm coding custom actions for the OnDelete event in my form. I've
noticed here in particular that any untrapped runtime error that occurs
during the form's OnDelete event will result in corruption of my database,
probably 9 times out of 10.
"What about the usual things? Name AutoCorrect off?"

Yes, Name AutoCorrect is off.
"What about the usual things? SP1 applied?"

Yes, SP1 is applied.
"What about the usual things? Decompile tried?"

Yes, one of the first things I try to do is decompile when I'm experiencing
database corruption. It never seems to resolve anything however.
"Guidelines for avoiding corruption (not specific to A2007): >http://allenbrowne.com/ser-25.html
Guidelines for uncorrupting a database:
http://allenbrowne.com/recover.html"

I have previously asked for resources on this forum regarding how to avoid
Access corruption and have been pointed to the links above. I've read those
resources and a few others and try to always work in a way to avoid known
ways of corrupting my database.

In the end, it seems Access 2007 is worse in this department compared to my
experiences working with Access 97, Access 2000, & Access 2003.
 
C

CrazyAccessProgrammer

While I'm frustrated with how often Access 2007 is corrupting on me during
development of my database, what you wrote is quite an exageration relative
to my actual experience with Jet. It's not as bad, at least to me, as you
suggest.
 
B

BruceM

Aaron infests this newsgroup from time to time with his rants against
Access/Jet. SQL Server is his answer to everything, yet he seems not to be
welcome in any of the SQL Server groups.

I am not very familiar with Access 2007, but I have not heard that it is
particularly prone to corruption. Here are a couple of things you could
check:
http://allenbrowne.com/bug-03.html
http://allenbrowne.com/Access2007.html

Also, there are some bugs listed here (various places on the page):
http://allenbrowne.com/tips.html

One more:
http://allenbrowne.com/Access2007.html#Bugs

There are other sites, I am sure, but Allen's site has a good consolidated
listing. A search about a specific problem may well turn up further
information.
 
D

David W. Fenton

=?Utf-8?B?Q3JhenlBY2Nlc3NQcm9ncmFtbWVy?=
I try copying in backup
objects (tables, forms, modules etc.)

Your app is not split. That's the first thing I'd rectify.
 
D

David W. Fenton

Aaron infests this newsgroup from time to time with his rants
against Access/Jet. SQL Server is his answer to everything, yet
he seems not to be welcome in any of the SQL Server groups.

He really doesn't know anything about SQL Server, either.

I think he's a very clever performance artist, knowingly posting
completely stupid and wrong things in an effort to make the rest of
us "perform."

I'd suggest completely ignoring him.

Alternatively, taunt him with his inability to stop responding to
criticisms of the errors in his posts -- that's good for a laugh
every now and then.
 
A

Allen Browne

Thanks: the extra detail helps understand when this occurs.

If you have not split the database, and it is being opened by multiple users
(or even multiple instances on your own computer), David's suggestion of
splitting will help. I assume you know what we are talking about here:
tables in one file in a shared location (the back end), and all other
objects (queries, forms, reports, code, ...) and attached tables in a
seprate file (the front end) such that each user opens an indepdent copy of
the front end.

Editing code in break mode can cause corruption IME. Merely pausing in break
mode (followed by a continue or reset) should not corrupt the file (unless
it affects some other dependences between classes or objects that disappear
when you reset.)

When you start modifying the design of a form, Access creates a backup
(which it will restore if you discard your current design changes.) When you
edit a form's module, it also creates a back up of the module. Consider what
happens if you open a form in Form view (not design view), start using it,
and then go to break mode. At this point, there is at least 1 copy of the
form, plus 2 copies of the code (the text version you view in the IDE, and
the compiled code that's running, which may or may not be saved.) Now if you
start editing the code in break mode, Access has to create a backup copy of
the code, and keep track of the backup to restore (with or without the saved
compiled code), plus the one being edited (which may or may not get saved in
the end), while actually still handling the compiled version that's running
(in break mode), and keep track of all this stuff correctly. It actually
does a pretty reasonable job of this most of the time, but IME there are
cases where it gets confused. You end up with a corrupt form, breakpoints
that don't break, code that executes which no longer exists in the module
(when you read the text version), or some other kind of corruption. And that
gets confused further by interacting with other bugs (such as with the
AccessField type where a form's module refuses to compile when it used to),
or inconsistencies between the forms in MSysObjects and those in AllForms.

I have no reason to think that A2007 is better/worse than other versions
with all of that.

But there is another factor with the Delete event. When Form_Delete fires,
Access has begun an implicit transaction that will be committed or rolled
back between BeforeDelConfirm and AfterDelConfirm. If you are experiencing
corruption when you interrupt it while the implicit transaction is active
(particularly if there are multiple users in the same file), I wonder if
something may be going wrong there?

Sorry: I can't be more specific. Hope that just talking about it may suggest
something that's worth considering, so you can find a path around whatever
is triggering this corruption.

IME, it's quite rare to get corruption of a completed project (where you are
not modifying forms/reports/code, e.g. of an MDE), but pretty common during
development.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

"CrazyAccessProgrammer" <[email protected]>
wrote in message
 
C

CrazyAccessProgrammer

I do understand that splitting the tables away to a backend file is important
and every finished Access application I make is set up in this way (front end
client with forms/reports/modules/queries etc and a back end with the tables).

At this stage in my development, the database has about 5 tables. Usually at
this stage of the game I keep the tables in the same file as all the other
objects to make developing less of a hassle. When the tables reach about 20
in number is when I usually make the split.
 
C

CrazyAccessProgrammer

If you have not split the database, and it is being opened by multiple users
(or even multiple instances on your own computer), David's suggestion of
splitting will help. I assume you know what we are talking about here:
tables in one file in a shared location (the back end), and all other
objects (queries, forms, reports, code, ...) and attached tables in a
seprate file (the front end) such that each user opens an indepdent copy of
the front end.

The database I'm working on right now is in development only and not being
used by anyone. So I haven't split the tables out yet. But yes I know about
frontend/backend and prior to deployment the tables will be split to a
backend.

Editing code in break mode can cause corruption IME. Merely pausing in break
mode (followed by a continue or reset) should not corrupt the file (unless
it affects some other dependences between classes or objects that disappear
when you reset.)

I believe this *may* be the main issue for me. In my original post I said
that I rarely edit code while in 'break' mode but since my original post I've
been paying extra special attention to what I'm doing and find that I am
quite often typing away in 'break' mode.

All day yesterday I made double sure NOT to type code in 'break' mode and
also did NOT experience any corruption in my database... the only day I've
had no corruption since I started building my brand new Access 2007 database
a month ago. So that's a telling trend.

A recomendation for Access 2007 would be to put an Access Application level
property where you could check a checkbox to disallow editing VBA code during
'break' mode.

To be honest, it's such a knee-jerk reaction to start fixing code right away
when you get a runtime error (and you are in break mode), it requires a lot
of concerted practice to retrain yourself NOT to do that... I guess I've been
doing it for years.
 
J

John W. Vinson

I believe this *may* be the main issue for me. In my original post I said
that I rarely edit code while in 'break' mode but since my original post I've
been paying extra special attention to what I'm doing and find that I am
quite often typing away in 'break' mode.

All day yesterday I made double sure NOT to type code in 'break' mode and
also did NOT experience any corruption in my database... the only day I've
had no corruption since I started building my brand new Access 2007 database
a month ago. So that's a telling trend.

Thanks for posting that, CAP! I've heard lots and lots of general warnings,
and had a "gut feel" that editing in break was risky, but this seems like a
much clearer testimonial.
A recomendation for Access 2007 would be to put an Access Application level
property where you could check a checkbox to disallow editing VBA code during
'break' mode.

That would be a VERY good idea (probably for Access 14 at this point). I hope
someone at the Summit sees this and talks to the Access team about it, and
will endeavor to see that they do!
 
A

a a r o n _ k e m p f

re:
Editing code in break mode can cause corruption

ARE YOU FUCKING KIDDING ME?
It's not editing in break mode that causes corruptions-- Jet corrupts
all the time and you blame it on _WHAT_?

Editing code in break mode never corrupts _DATA_ for me, because I
keep my data and my queries-- where they belong (SQL Server)
 
A

a a r o n _ k e m p f

David;

**** you and your mis-information.

I'm a certified DBA... I've been writing SQL Server fulltime every day
for the past decade.

Prior to that, I have several years of Access and VB development
experience.

Your mis-information campaign isn't useful, it's not truthful.

Just because you use a piece of shit ass database-- that doesn't mean
that I don't know SQL !

-Aaron
 
A

a a r o n _ k e m p f

a single corruption in a decade-- is too much for me!

I've seen Jet corrupt ~~100 times.. and thats ~~100 times too many for
me!

-Aaron
 
A

a a r o n _ k e m p f

no shit Access 2007 is worse-- you're using Jet, which has been
obsolete for a decade.

wake up and smell the coffee, bitch

you chose the wrong database / architecture.. and now you're sitting
there wondering why it crashes?
grows some balls, kid!

Upsize to SQL Server!

-Aaron
 
P

Paul Shapiro

You might check that you have Office SP1 and the post-SP1 Access hotfixes
installed. They fixed a lot of bugs. I probably edit in break mode a few
times per day, and I don't remember the last time a db got corrupted. I keep
the active db on my local disk drive, which was something I didn't need to
do with earlier Access versions. I use SourceSafe integration to keep the
code backed up, and the SourceSafe data is on the server.

I seem to remember I moved the development db to the local disk because with
Access 2007, at least pre-SP1, performance was terrible when the db was on
the server. Maybe corruption was a problem then too, but I don't remember
any more. Since the "My Documents" folder is redirected to the server, I was
used to working from the server with earlier Access versions.

The other thing that made a big difference with A2007 was making sure mdb
files were excluded from all antivirus/antispyware checking. Again, I don't
remember if corruption was a problem but performance definitely was.
 
D

David W. Fenton

=?Utf-8?B?Q3JhenlBY2Nlc3NQcm9ncmFtbWVy?=
I do understand that splitting the tables away to a backend file
is important and every finished Access application I make is set
up in this way (front end client with
forms/reports/modules/queries etc and a back end with the tables).

At this stage in my development, the database has about 5 tables.
Usually at this stage of the game I keep the tables in the same
file as all the other objects to make developing less of a hassle.
When the tables reach about 20 in number is when I usually make
the split.

So, have you split it?

Until you've eliminated that as a potential cause of the problem, I,
for one, am not interested in racking my brain for possible causes
of your problems.
 
D

David W. Fenton

Editing code in break mode can cause corruption IME.

I do it all the time. I have not had code corruption in about 5
years.

Then again, I compile frequently and decompile often, and run with
COMPILE ON DEMAND turned off.
 
D

David W. Fenton

When you start modifying the design of a form, Access creates a
backup...

Interesting explanation, Allen.

When I change code in break mode, I immediately compile and save.
Does this discard all the temporary copies? If so, that seems to me
that it would be a good way to avoid corruption, and is, perhaps,
why I have not had any even thought I change code in break mode on a
daily basis (a habit I developed in A97 and have never abandoned).

I still don't understand why the compile button is not on the VBE
toolbar by default (also the call stack button) -- I always have to
add it to any instance of Access I use. I hit that button ALL THE
TIME when coding (as well as the SAVE button). It just seems obvious
to me that any line of code that you change needs to be compiled and
saved, particularly so in break mode.
 

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