ACC97: Renaming Database Does Not Cause Code to Decompile
ID: Q160752
|
The information in this article applies to:
SYMPTOMS
Moderate: Requires basic macro, coding, and interoperability skills.
The Microsoft Access 97 Help file contains the following incorrect
statement about what happens to Visual Basic for Applications code
when you rename a database:
When you rename a database, compiled code in the database will be
decompiled. To recompile code and save all modules in a compiled state,
open the database, open a module in Design view, and click Compile And
Save All Modules on the Debug menu.
RESOLUTION
Microsoft Access 97 does not exhibit this behavior. When you rename a
database in Microsoft Access 97 the code is not decompiled.
MORE INFORMATION
Each Microsoft Access database contains a Visual Basic project, which is
the set of all code modules in the database. In Microsoft Access 7.0, the
database name and the project name are always the same. Therefore in
Microsoft Access 7.0, renaming a database renames the project, and renaming
the project causes your code to decompile.
In Microsoft Access 97, when you create a new database, the project name
defaults to the database name. However, in Microsoft Access 97, the project
name is independent of the database name. If you rename a database file,
its project name does not change; therefore, your code does not decompile.
To set the project name for your database in Microsoft Access 97:
- On the Tools menu, click Options.
- In the Options dialog box, click the Advanced tab.
- Type the name of your project in the Project Name box, and then click
OK.
To compile your code under the new project name:
- Open any module in Design view.
- On the Debug menu, click "Compile and Save All Modules."
Steps to Reproduce Behavior
- On the Help menu, click Contents And Index.
- In the Help Topics dialog box, click the Index tab.
- Search for "converting code," and then open that topic.
- Click the jump entitled "Convert Access Basic Code to Visual Basic."
- Scroll down to the section called "Renaming a Database."
Keywords : kbusage
Version : 97
Platform : WINDOWS
Issue type :