Can COMPILE ON DEMAND result database corruption?

  • Thread starter Vladimír Cvajniga
  • Start date
V

Vladimír Cvajniga

Is it a known issue?

Vladimir Cvajniga: COMPILE ON DEMAND is ON.
David W. Fenton: Turn it OFF and you'll have less corruption.

See David W. Fenton's post (March 4 th 2007 14:55) in the thread "Frequent
Access 2003 corruption that cannot be repaired".
 
T

Tom Wickerath

Hi Vladimir,

Most JET database corruption is caused by interrupted write operations. The
Compile on Demand option allows one to run code in their database without
first compiling it--it is literally compiled on demand, as needed, as each
module is loaded. Suppose a developer has code in module A that will not
compile, but releases the database to production in an uncompiled state. If
code in another module is executed, which involves opening a recordset to
edit records and which includes a call to a function in module A, then a
update operation could potentially be left in an incomplete state. I would
not put it above the realm of possibility that such code that chokes in the
middle of a write operation might result in a corrupted database. Pure
speculation on my part, but I think it is certainly a possibility.

Here is information that I have previously posted on this subject. Scroll
down the page a bit, until you see the section titled Avoid "Compile on
Demand":

http://www.access.qbuilt.com/html/gem_tips.html#VBEOptions

FYI - As you read more posts on the newsgroups microsoft.public.access.X
(and comp.databases.ms-access), there are certain names that you will start
recognizing as generally providing trustworthy information. David Fenton is
one of those people. He knows more about the inner workings of Access than
the average person.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
V

Vladimír Cvajniga

TYVM for your respond, Tom.

I know that David Fenton belongs to the group of the best programmers here.
But this information is really worth noticing... I mean MS will not ignore
it. ;-)

I'd like to thank you for the link, too.

Vlado
 
T

Tom Wickerath

Hi Vlado,
I mean MS will not ignore it. ;-)

I wouldn't count on it. The VBA team at Microsoft seems to have ignored the
advice published in this article, by someone else at Microsoft:

A Word About Writing Solid Script
http://msdn2.microsoft.com/en-us/library/aa188501(office.10).aspx

I'm referring to the following quote:

"However, every experienced developer knows that the failure to use the
Option Explicit statement to force explicit variable declaration is a coding
blunder of the highest order. Using undeclared variables can introduce
subtle, hard-to-find bugs into your code that are easily avoided by using
this one, simple technique."

Have you noticed that out-of-the-box, a fresh installation of Office (name
your version) does not include "Require Variable Declaration" as a default
checked option? At least this is true in all of the English language copies
that I have looked at.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
V

Vladimír Cvajniga

Hello, Tom,

MS guys seem that they ignore some recommendations... even from their
colleagues. ;-(
It's poor programming-language-design if it enables you to omit basics of
programming.

Luckily, I'm comming from Pascal-programmer-group so that I always declare
variables. But to avoid problems I always check this setting in VB & VBA
immediatelly after new installation. ;-)

Vlado
 
Top