VBA project contained in it cannot be read

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • n8stone108
    New Member
    • Mar 2013
    • 6

    VBA project contained in it cannot be read

    I am trying to recover a database in Access 2007. I do not have a viable backup. The error message is:

    "The database cannot be opened because the VBA project contained in it cannot be read. The database can be opened only if the VBA project is first deleted. Deleting the VBA project removes all code from modules, forms and reports. You should back up your database before attempting to open the database and delete the VBA project"

    I have tried to recreate the database by importing everything from this database with no luck. I have also tried many of the solutions offered on search results from Google and forums.

    Does anyone have a solution to this problem?

    Is there software to fix this? Or is there an easy way to rebuild the database while maintaining the VBA modules?

    I would greatly appreciate any help that is offered.

    Thanks,
    Nathan
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    I assume based on the error message that you get this when you first open the database? See if you can open the database while holding the shift key down. This will disable any code/macro that would try to run on startup. I'm not sure if this will help or not, but it is worth a try.

    Comment

    • zmbd
      Recognized Expert Moderator Expert
      • Mar 2012
      • 5501

      #3
      Basically, Your VBA is hosed.
      Try opening the file while holding down the shift key...

      This often happens when people with two different versions of access open the same frontend/database (another member ran into just this case not too long ago: http://bytes.com/topic/access/answer...ed-cannot-read

      Have you tried to decompile?

      Comment

      • neelsfer
        Contributor
        • Oct 2010
        • 547

        #4
        my 2c worth. I have had a similar experience and if my memory serves my right it was vba in a specfic form that crashed everything.I imported all the tables, queries,modules etc first, and then the forms one by one into a new database to identify the culprit. From that day i have always copy and pasted my working file in the same folder, before making any changes. good luck!

        Comment

        • n8stone108
          New Member
          • Mar 2013
          • 6

          #5
          Seth & zmbd,

          Yes, I get the error message as soon as the database is opened. I have already tried holding in [SHIFT] while opening the database and unfortunately, it didn't work :-(

          I have not tried to decompile. I will try that and get back to you.

          Thanks for your input :-)
          Last edited by n8stone108; Mar 28 '13, 11:17 AM. Reason: updating response

          Comment

          • n8stone108
            New Member
            • Mar 2013
            • 6

            #6
            neelsfer:

            I have already tried to import the tables, queries, modules, etc...however I get the same error message no matter which form I try to import :-(

            Thanks for your input :-)

            Comment

            • n8stone108
              New Member
              • Mar 2013
              • 6

              #7
              zmbd,

              The decompile did not work...I still get the same error message.

              Comment

              • n8stone108
                New Member
                • Mar 2013
                • 6

                #8
                Has anyone ever tried to recover a database with the software from SysTools entitled Access Recovery? Link for it here:
                SysTools Access Recovery Software allows users to recover lost data from access databse file. Download Access database recovery tool free demo version and test its working.


                Not sure if this would even work for the VBA error problem or not...but I thought I would ask.

                Comment

                • zmbd
                  Recognized Expert Moderator Expert
                  • Mar 2012
                  • 5501

                  #9
                  Can't comment on the tool you're looking at as I've never used it.

                  Does any of this fit your situation - I know it says for v2010; however, if you're doing something along this same lines in V2007 you can run into the same issue: Microsoft Access databases that are created by using the 64-bit version of Microsoft Access 2010 and that are compiled as MDE, ACCDE, and ADE files have to be recompiled in Microsoft Access 2010 Service Pack 1 (SP1) to work correctly with Access 2010 SP1

                  So if this is along the same lines, then get and install all of the updates for your version of Office. Then do a decompile/recompile.

                  Comment

                  • zmbd
                    Recognized Expert Moderator Expert
                    • Mar 2012
                    • 5501

                    #10
                    Ok,
                    Here's a tedious method....
                    Open a new database - Import all of your tables and queries.
                    NO reports, No forms, etc... just T and Q.
                    We're going to use this as a "template."
                    Make a copy of the temp database.
                    Import just one form.
                    Close and open this file... if all is good, then, VBA - Debug Compile, database tools repair and compact. Mark the file as good.
                    repeat for each form.
                    repeat for each VBA module.
                    One of these is the Grim that is killing your database and this is about the only way to get at it.
                    You can then merge all of the good forms/code... one form at a time... so start with one of the "good" files, make a copy of it and then start your import.

                    Comment

                    • zmbd
                      Recognized Expert Moderator Expert
                      • Mar 2012
                      • 5501

                      #11
                      One more thing... sorry, busy morning already...
                      When you decompiled you did use somthing like the following either in a shortcut, or via command line:
                      msaccess /decompile <your database name>
                      (you may need the full path to Access and to Your Database)

                      I have a shortcut on my desktop that I copied from the normal shortcut and added the decompile switch. I just do a drag and drop of the file on that when I need/want to decompile.


                      Can I say it... back ups are a must! (sorry, been biting my tongue on that :) )

                      Comment

                      • n8stone108
                        New Member
                        • Mar 2013
                        • 6

                        #12
                        zmbd,

                        Hello again...yes I did try the shortcut for the msaccess/decompile and that did not work.

                        On a much, much more positive note :-)

                        Another person at the office used your "tedious" method and that seemed to do the trick for all but the one form. I thank you very much for your help in resolving this issue.

                        Best Regards,
                        Nathan

                        Comment

                        Working...