• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

Converting from access 2003 to access 2010 code disappears

We are in the process of testing the conversion from 2003-2010 ms access and I am having problems viewing my code.  Some databases I am able to see the code and others it is completely gone.  The documentation I have found online about the registry changes is not very clear and was wondering if you knew what I needed to do to fix this issue with the code disappearing?
0
sannunzi
Asked:
sannunzi
1 Solution
 
Dale FyeCommented:
You are not looking at mde or accde files are you?  You won't be able to see the code in those file types.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
I would recommend you run the procedure below on any A2003 db you are converting - before doing the conversion, such that you start with a 'clean' A2003 db. Fix any issues that arise.  Then, instead of actually using the Convert To utility in A2010, instead create a blank A2010 accdb and Import all objects (except linked tables) into the A2010 accdb.

====

A **DeCompile** may help here ...

But first, if you have not already:
Open the VBA Editor and from the menu ...Tools>>References ....
If you see any listed as **Missing: <reference name>, including the asterisks and the word Missing, the
you need to fix that first.

Then, follow this procedure:

****
0) **Backup your MDB BEFORE running this procedure**
****
1) Compact and Repair the MDB, as follows:
Hold down the Shift key and open the MDB, then from the menu >>Tools>>Database Utilities>>Compact and Repair ...
Close the mdb after the Compact & Repair.
2) Execute the Decompile (See example syntax below) >> after which, your database will reopen.
3) Close the mdb
4) Open the mdb and do a Compact and Repair (#1 above).
5) Close the mdb.
6) Open the mdb:
    a) Right click over a 'blank' area of the database window (container) and select Visual Basic Editor. A new window will open with the title 'Microsoft Visual Basic' ... followed by then name of your MDB.
    b) From the VBA Editor Menu at the top of the window:
       >>Debug>>Compile
        Note ... after the word Compile ...you will see the name of your 'Project' - just an fyi.

7) Close the mdb
8) Compact and Repair one more time.

*** Executing the DeCompile **EXAMPLE**:
Here is an **example** of the command line syntax  (be SURE to adjust your path and file name accordingly) before executing the decompile:

Run this from Start>>Run, enter the following command line - **all on one line** - it may appear like two lines here in the post:
Also, the double quotes are required.

"C:\Program Files\Microsoft Office\Office\Msaccess.exe" /decompile "C:\Access2003Clients\YourMdbNameHERE.mdb"

For more detail on the Decompile subject ... visit the Master on the subject (and other great stuff) Michael Kaplan:

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

AND ...
Once you get familiar with the Decompile idea (and ALWAYS make a BACKUP first!) ... you can add both Decompile and Compact/Repair to the Right Click menus in Windows Explorer, which I use multiple times daily:

Getting the Decompile and Compact context menu options
http://access.mvps.org/access/modules/mdl0039.htm

mx
0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
Better yet, create a new DB in 2003, import everything into it, then move it to 2010.

You've got some corruption, either in the VBA project file or the DB itself.

Jim.
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:

 and also make sure it compiles cleanly before you do anything with it in 2010.

Jim.
0
 
sannunziAuthor Commented:
I had just removed a form from my database, and had some code that referenced it.  Thanks.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
Still ... I would highly recommend you follow the procedure I posted ....
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now