Reserved words get 'redefined'

T

Tony

Hi All,

A couple of times I've 'redefined' reserved words such that I end up
corrupting my database (Access2K). For example, I set up a query and set a
field's name to 'DESCRIPTION'. From that point forward, Access thinks I'm
referring to the 'DESCRIPTION' as opposed to Description (as in MsgBox
Err.Desciption). I recover by going to my backup copy of my development
database and recreating anything that I've changed after confusing Access.

Does anyone know if, buried in the guts of the database, I can correct this
type of error? Perhaps in a system table?

Thanks,

Tony
 
A

Allen Browne

There's a couple of possible issues here.

The first is to make sure the Name AutoCorrect boxes are unchecked under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html
Then compact the database:
Tools | Database Utilities | Compact/Repair

If this is happening in code, a decompile might help. 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"
Then open Access (holding down the Shift key if you have any startup code),
and compact again.

If you're completely stuck, an extreme workaround might be to cut all the
text of the module out, and save in Notepad. Then delete the module (if it's
a standalone module), or set the HasModule property to No (if it's the
module of a form or report.) Save. Compact. Then paste the code back in.
 
T

Tony

Allen,

Thanks for the advice. I've gone the cut/paste code route up to this point
but it's sometimes a lot of work. I'll try decompile the next time this
happens. I should have learned my lesson by now.

Ciao,

Tony
 

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