Corrupt Database

CCIDBMNG

Registered User.
Local time
Today, 07:35
Joined
Jan 25, 2002
Messages
154
Out of no where VB has some how become corrupt in one of my databases. When you try to open a form or report that has VBA code written I receive an error stating the database is corrupt and to do a compact and repair. I tried this and it didn't help. I also get the error Microsoft is unable to load the Visual Basic for Applications dynamic link library (DLL) VBe6. Rerun the microsoft office access setup program. I've tried this also and this did not work. Does anyone have any idea how to fix this? Or why it is happening to just one of our databases. Microsoft says something about there being a fix in their Service Pack 2 but we have that service pack.
 
Try importing everything into a new, blank db. If that does not fix the problem then import everything except the forms/reports that are not working. Then import them one at a time and test the db after each import. If you still have corrupt forms you are probably looking at using your backup or rebuilding your forms and reports from scratch...

hth,
Jack
 
We did that. The tables and queries are fine but the forms and reports won't import. Is my only option to recreate all of them? And how and why did this happen?
 
If you have done everything possible and the forms and reports will not work then you are, as far as I know, out of luck. If you have a backup then that is your salvation otherwise it is back to creating new forms and reports... As to why this happened I haven't a clue. Sometimes things go awry and and there is no obvious reason...

Jack
 
You could try to decompile the database.

From the Start button, use this in the Run... command

"C:\Program Files\Microsoft Office\Office\msaccess.exe" /decompile "X:\YouDatabase.mdb"

After you decompile your db, you need to compile it. Open a module, click
the Debug option on the menu bar and select the Compile and Save All
Modules option.

Your last step is to Compact your db and you might also notice a decrease in size the "first" time you decompile your db.

HTH
 
Last edited:
One other shot in the dark. If your running Access 97 or 2K you could try upgrading the db to Access XP. I've had success doing this when a 97 db corrupted and 97 tools wouldn't recover the db.

Take note of Jacks comments re back up. You can help your self by backing up your important files daily. When something like this happens they're worth their weight in gold.
 
Ok I tried the decompile but it gives me the error message that the database is corrupt and doesn't finish decompiling. I'm using Access 2003 and I tried converting it to an earlier version but again I get that error message. I've also tried importing the forms one at a time but it won't let me import any of them as soon as I click import and choose that database I get the corrupt message.
 
There is a Jet utility that you can get from the Microsoft download site. It may be able to recover the db for you. That's the last option short of paying the owners of a site like this to recover the db if they can.
 
Well I downloaded the jet utility and it creates the new database but I have the same error in the database. I've also submitted the database to the owner's of this site and I was told they can not recover forms or reports. So I guess my only option is to recreate the all the forms and reports. I just wish I knew how this happened.
 
I noticed that nobody has mentioned the SaveAsText method. You can save the object [form, module, etc.] as a text file then import it into another [or the same] database. Worth a try.

Application.SaveAsText acTable, "ObjectNameHere", "C:\Temp\Table.txt"
Application.SaveAsText acQuery, "ObjectNameHere", "C:\Temp\Query.txt"
Application.SaveAsText acReport, "ObjectNameHere", "C:\Temp\Report.txt"
Application.SaveAsText acModule, "ObjectNameHere", "C:\Temp\Module.txt"
Application.SaveAsText acForm, "ObjectNameHere", "C:\Temp\Form.txt"
Application.SaveAsText acMacro, "ObjectNameHere", "C:\Temp\Macro.txt"

Then use the Application.LoadFromText method to import the text file into your db.

Application.LoadFromText acTable, "ObjectNameHere", "C:\Temp\Table.txt"

The SaveAsText & LoadFromText application options are undocumented Access commands

Good luck!
 
Where do I need to place that in the VBA module of the object? If so it won't work because I can't access the VBA module of that database that is when I get the error unable to load vbe6.dll.
 
Is there a way to use the SaveAsText to save the forms and reports from a seperate database. I can access the VBA modules from any other database just not the corrupted one.
 
Ok I figured out how to reference a different database using the SaveAsText function but when I try to use it on the forms/reports from the corrupted database it gives me the currupted database error and it doesn't save.
 
i know its shuutting the stable door etc, but it is unforgiveable to lose a code database - occasionally i get this situation while developing - if you cant recover the database, then you go back to an old version, and redo the last bits

its always an issue with backends, because it may be hard to reconstruct the changes since the last backup.

also make sure you copy ALL your code databases to a portable drive, or some other safe backup, just in case you have a disk crash
 

Users who are viewing this thread

Back
Top Bottom