Connecting Tech Pros Worldwide Forums | Help | Site Map

Corrupt VBA project in the database

Simon
Guest
 
Posts: n/a
#1: Jan 9 '06
Dear reader,



I can't repair this with Tools>>Database utilities>>Compact and repair
database....



And another way around: after creating a new database and start import all
object the same message appears:

"Visual Basic for applications project in the database is
corrupt."



Is there any other solution to solve this problem?



Thanks for any help.

Kind regards,

Simon van Beek



Allen Browne
Guest
 
Posts: n/a
#2: Jan 9 '06

re: Corrupt VBA project in the database


At what point do you receive this message? Immediately you start to import?
When it gets to a particular form during the import process?

I would expect you could import your tables and queries into the new
database. If a particular form fails, try importing all the others. There
may be 2 or 3 forms/reports that will fail, but you have all the others.

Decompile a copy of 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 compact:
Tools | Database Utilites | Compact

Another option would be to export the form to a text file, e.g.:
SaveAsText acForm, "Form1", "C:\Form1.txt"
If that works, you will probably be able to import it into the new database
with:
LoadFromText acForm, "Form1", "C:\Form1.txt"

If you are actually able to open the bad form in design view anyway, another
option would be to copy all the text from its code window out to notepad.
Then set the form's HasModule property to No. Save. Close it. Compact the
database. Try importing the form. If it works, you can then paste in the
text into its code window from notepad.

For other general suggestions on handling database corruptions see:
Recovering from Corruption
at:
http://allenbrowne.com/ser-47.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Simon" <S.vanBeek@HCCnet.nl> wrote in message
news:43c1a59d$0$804$3a628fcd@textreader.nntp.hccne t.nl...[color=blue]
> Dear reader,
>
>
>
> I can't repair this with Tools>>Database utilities>>Compact and repair
> database....
>
>
>
> And another way around: after creating a new database and start import
> all
> object the same message appears:
>
> "Visual Basic for applications project in the database is
> corrupt."
>
>
>
> Is there any other solution to solve this problem?
>
>
>
> Thanks for any help.
>
> Kind regards,
>
> Simon van Beek[/color]


Bernard Peek
Guest
 
Posts: n/a
#3: Jan 9 '06

re: Corrupt VBA project in the database


In message <43c1a59d$0$804$3a628fcd@textreader.nntp.hccnet.nl >, Simon
<S.vanBeek@HCCnet.nl> writes
[color=blue]
> "Visual Basic for applications project in the database is
>corrupt."[/color]

I've seen that error message when importing forms. The problem was that
one of the forms was linked to a query that had been deleted from the
database. When I fixed that problem the import worked.



--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author.

Closed Thread