Database corrupted during code save

L

Lisa

HI.

I had added a reference to Outlook 11, but my shared user has Outlook 10. I
tried to set the reference on his computer to Outlook 10 and then tried to
save the code but it crashed.

Now my database is corrupt and I can't get into the code at all to remove
the problem. I can export tables and queries, but no forms, reports or code
modules.

PLEASE HELP

Is there anyway you can get my back into my code to remove the Outlook
reference and save my file - no, I don't have a backup copy :-(

Thank you so much for any help
 
L

Lisa

More info:

I've tried to compact and repair
I've tried the Start Run and using the /decompile

Access error is that the file is corrupt

Thanks
Lisa
 
K

Klatuu

Sorry, lisa, but you may be prettty much hosed.
Here is something you can try.
If you can open your forms, reports, and modules in design view and for the
forms and report open their code modules in VBE, then you may be able to save
them. Here is the routine.
For forms and reports that have code modules.
Open the object in design view and open its code module in design view.
Copy/Paste the code into a notepad (.txt) file.
Close the code module.
change the object's Has Module property to No.
Save the object.
Do this for all forms and reports.
Copy paste your standard modules to text files also.

Open a new mdb.
Import all the object from the corrupt mdb. Since it is a code issue,
hopefully this will resolve the issue.

Once you have all the objects imported, you can now paste your code back in.
So then you open the form/report objects. Open the code module for them.
They should be blanks. Copy/Paste the code from the associated text file
into the blank module. Save the object.
Same for standard modules, just create a new module, paste the code into it,
name it and save it.
MAKE A COPY!
now compact and repair
MAKE A COPY!

What are you using the reference to Outlook for?
It may be possible to not have the reference in VBA at all. When you Dim an
Outlook (or any other Office libarary), don't dim it as an application, but
just as an object. Then when you create the object. you just specify the
object type at that time. It will pick up the reference autmatically. That
is called Late Binding and will protect you against just such situations as
this.

and before you leave for the day,
MAKE A COPY!

Good Luck.
 
L

Lisa

Hi. I think I'm hosed.

I can open the forms in design view, but I can't get into the code module,
it won't open. It errors "corruption in the file."

PS thanks for the tips on copying my file, they'll be very helpful in the
future ;-)

Lisa
 
K

Klatuu

Sorry to hear that.
Have tried opening a standard module or even creating a new standard module
to see if you can remove the reference?

Next try importing a corrupt form to a new mdb and see if you can get to the
code module there.

If that doesn't work, see if you can at least save the form, even if cant
open the module part. Just open the form in design view, set the Has Module
property to no and save the form. If it allows that, at least you can import
it into a new mdb and save the time to redesign the form.

If none of that works, take your computer, a 12 guage shotgun, and a couple
of boxes of #4 shells to a remote location in the country (be sure there are
no cows down range) and work out your frustrations :)
 
L

Lisa

Tried it all, can't do any thing with an object that has a module.

The only thing I can do is open the form in design view, select all the
objects and paste into a new form in my new database.....

sucks to be me.
Lisa
 
T

Tony Toews [MVP]

Lisa said:
Is there anyway you can get my back into my code to remove the Outlook
reference and save my file - no, I don't have a backup copy :-(

Make a copy of the MDB before doing anything else.

Try decompiling. Decompile or how to reduce Microsoft Access MDB/MDE
size and decrease start-up times
http://www.granite.ab.ca/access/decompile.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
A

Alan

HI.

I had added a reference to Outlook 11, but my shared user has Outlook 10.  I
tried to set the reference on his computer to Outlook 10 and then tried to
save the code but it crashed.

Now my database is corrupt and I can't get into the code at all to remove
the problem.  I can export tables and queries, but no forms, reports or code
modules.

PLEASE HELP

Is there anyway you can get my back into my code to remove the Outlook
reference and save my file - no, I don't have a backup copy :-(

Thank you so much for any help

Create a new, empty database. In Access, go to File menu-> Get
External Data-> Import. Now you can import every valid table. This
will give you a clean set of systems tables. If this still does not
work, you may need some professional service. You can try Advanced
Access Repair at http://www.datanumen.com/aar/ This tool is rather
useful in salvaging damaged Access MDB files. Hope this helps.
 
T

Tony Toews [MVP]

Alan said:
You can try Advanced
Access Repair at http://www.datanumen.com/aar/ This tool is rather
useful in salvaging damaged Access MDB files. Hope this helps.

You also work for that company. Posting without disclosing any
connection is highly unethical and sleazy.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
R

Robert Morley

While I'll be the first to agree, his e-mail address pretty much gives it
away anyway. A clear statement woulda been better, but at least in my mind,
having an address at that company is sufficient.


Rob
 
T

Tony Toews [MVP]

Robert Morley said:
While I'll be the first to agree, his e-mail address pretty much gives it
away anyway. A clear statement woulda been better, but at least in my mind,
having an address at that company is sufficient.

Not sufficient enough in my opinion. He should also be adding
wording such as "my company sells ..."

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top