Decompile crashes the database

L

Larry Kahm

I just replaced a significant portion of a client's front-end database today
and after compacting the mdb, decided that it would be appropriate to
decompile and compact it prior to creating the mde.

I have a standard shortcut that runs the decompile and it immediately
crashed Access and sent up the "Send results to Microsoft" message box.

The site is using Access 2000 and SP3 was just applied today (yeah, I
know...).

I can't seem to find any reported problems about decompile. Has anyone
encountered this in the past, and if so - what did you do? Are there any
hotfixes for A2K that I should have their IT guy take a look at?

Thanks!

Larry
 
B

Bryan

Hey Larry -

I haven't heard of any issues with the Decompile in Access. Have you tried
to Decompile from the command prompt (or Run on the start menu)?

I have had problems with decompiling dbs with spaces in the path or
filename. I usually rename it and move it to the root of the C: drive to
decompile.

Make sure that you have the path and filenames to Access are in quotes for
names with spaces - "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"
/decompile C:\YOURFILENAME.mdb

Hope that works for you.

Bryan..
 
A

Arvin Meyer MVP

Larry Kahm said:
I just replaced a significant portion of a client's front-end database
today and after compacting the mdb, decided that it would be appropriate to
decompile and compact it prior to creating the mde.

I have a standard shortcut that runs the decompile and it immediately
crashed Access and sent up the "Send results to Microsoft" message box.

The site is using Access 2000 and SP3 was just applied today (yeah, I
know...).

I can't seem to find any reported problems about decompile. Has anyone
encountered this in the past, and if so - what did you do? Are there any
hotfixes for A2K that I should have their IT guy take a look at?

There are a few folks that decompile routinely. I'd advise doing it only
when you have a problem, and then on a copy of the database. Access 2000 had
a bad habit of crashing during development, but was stable during use.

You might consider using SaveAsText and LoadFromText, also undocumented, to
recreate a new clean database then compile that.
 
A

Albert D. Kallal

When you decompile, I assume you hold down the shift key to prevent any code
from re-compiling?
(I mean, you kind of defeating the purpose of de-compiling if you let code
run and re-compile).

So, I usually hold down the shift key. I also usually to exit the
application at that point (since the startup options had a de-compile). I
then re-enter the application regular way without a shortcut. I also again
hold down the shift key. At that point a do a compact-repair (again...don't
let any code run via shift key).


try the above..
 
L

Larry Kahm

Got it!

And, yes, I always safeguard my work - even while doing incremental updates.

Thanks!
 
L

Larry Kahm

Yes, I do know to hold the shift key - and was doing so when it crashed.

Haven't been able to get past that to do the second part...
 
D

David W. Fenton

The decompile switch is undocumented, unsupported and wasn't
intended to be used the way you are using it. In Michael Kaplan's
words, "IF IT AIN'T BROKE, DON'T FIX IT." According to Michael's
advice, don't use decompile constantly because "you are relying on
the canonical text always being completely valid, and you are
relying on the ability to globally invalidate a compiled state.
If there is ever a problem in either area, /decompile will take a
project that was working fine and turn it into cottage cheese."

I think Michael's warning on /decompile was always hysterically
overblown, as I use it regularly as a part of my development
process.

Of course, I also compile frequently (after every few lines of
code), and decompile only after making a backup. I've only lost a
few lines of code a couple of times, and that was only when
decompiling after a database was already crashing. Sometimes the
decompile would crash Access, but then a compact and another
decompile would work (and in those cases, some code could be lost).

The danger, I think, is in decompiling only very rarely (i.e., just
before distributing your app). If you do it often, you keep the crud
out of the compiled code and don't run into problems.

In my experience, that is.

Of course, you also have to have COMPILE ON DEMAND turned off and
you have to use OPTION EXPLICIT everywhere and you have to compile
regularly. This insures that you don't have bad problems developing
in your project over time, and thus, there's very little chance of
loss of canonical code when decompiling.

MichKa made that recommendation back in 1999. At that point, I'd
already been decompiling A97 very frequently (moreso than I
decompile in later versions) and had never lost a line of code
except when I knew the code was already corrupted when I decompiled.
And in the 10 years since then, I don't recall losing a single line
of code (at least not enough of it for it to be a bad enough problem
to be memorable). So, I really think MichKa was overstating the
danger.

Of course, backup, backup, backup insures that you never lose
anything.
 
D

David W. Fenton

Access 2000 had
a bad habit of crashing during development, but was stable during
use.

That was pre-SR2, I think. I've worked extensively in A2000 for one
of my clients and once it got patched, it's been completely stable
during development.
 
D

David W. Fenton

When you decompile, I assume you hold down the shift key to
prevent any code from re-compiling?
(I mean, you kind of defeating the purpose of de-compiling if you
let code run and re-compile).

So, I usually hold down the shift key. I also usually to exit the
application at that point (since the startup options had a
de-compile). I then re-enter the application regular way without a
shortcut. I also again hold down the shift key. At that point a do
a compact-repair (again...don't let any code run via shift key).

Just to put Albert's instructions in list form:

0. make a backup.

1. holding the SHIFT key, open your app with /decompile switch.

2. close the instance of Access that was opened with /decompile.

3. open a new instance of Access and open your MDB holding the SHIFT
key.

4. holding the SHIFT key, compact.

5. compile your app.

6. holding the SHIFT key, compact again.

And be sure that your Access options includes these settings:

1. OPTION EXPLICIT required in all modules.

2. COMPILE ON DEMAND turned off.

3. COMPACT ON CLOSE turned off.
 
L

Larry Kahm

Got it, thanks!

Larry

David W. Fenton said:
Just to put Albert's instructions in list form:

0. make a backup.

1. holding the SHIFT key, open your app with /decompile switch.

2. close the instance of Access that was opened with /decompile.

3. open a new instance of Access and open your MDB holding the SHIFT
key.

4. holding the SHIFT key, compact.

5. compile your app.

6. holding the SHIFT key, compact again.

And be sure that your Access options includes these settings:

1. OPTION EXPLICIT required in all modules.

2. COMPILE ON DEMAND turned off.

3. COMPACT ON CLOSE turned off.
 
T

Tony Toews [MVP]

Chris O'C via AccessMonster.com said:
The decompile switch is undocumented, unsupported and wasn't intended to be
used the way you are using it. In Michael Kaplan's words, "IF IT AIN'T BROKE,
DON'T FIX IT." According to Michael's advice, don't use decompile constantly
because "you are relying on the canonical text always being completely valid,
and you are relying on the ability to globally invalidate a compiled state.
If there is ever a problem in either area, /decompile will take a project
that was working fine and turn it into cottage cheese."

http://www.trigeminal.com/usenet/usenet004.asp?1033

I disagree with Michael's comments there. If there is a problem with
the MDB and decompile brings it to light then good. Better to find a
problem sooner rather than later and have to go to a backup that's a
week old then an hour old.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
P

(PeteCresswell)

Per Arvin Meyer MVP:
You might consider using SaveAsText and LoadFromText, also undocumented, to
recreate a new clean database then compile that.

Just be sure to remember if you have any import templates defined
- which are kind of hidden and have tb manually re-created.
 

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