Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / May 2008

Tip: Looking for answers? Try searching our database.

Database corrupted during code save

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lisa - 20 May 2008 22:16 GMT
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
Lisa - 20 May 2008 22:24 GMT
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

> HI.
>
[quoted text clipped - 12 lines]
>
> Thank you so much for any help
Klatuu - 20 May 2008 23:02 GMT
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.

Signature

Dave Hargis, Microsoft Access MVP

> More info:
>
[quoted text clipped - 22 lines]
> >
> > Thank you so much for any help
Lisa - 20 May 2008 23:08 GMT
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

> Sorry, lisa, but you may be prettty much hosed.
> Here is something you can try.
[quoted text clipped - 63 lines]
> > >
> > > Thank you so much for any help
Klatuu - 20 May 2008 23:16 GMT
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 :)
Signature

Dave Hargis, Microsoft Access MVP

> Hi.  I think I'm hosed.
>
[quoted text clipped - 73 lines]
> > > >
> > > > Thank you so much for any help
Lisa - 20 May 2008 23:34 GMT
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

> Sorry to hear that.
> Have tried opening a standard module or even creating a new standard module
[quoted text clipped - 89 lines]
> > > > >
> > > > > Thank you so much for any help
Tony Toews [MVP] - 21 May 2008 05:28 GMT
>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
Signature

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/

Alan - 27 May 2008 15:09 GMT
> HI.
>
[quoted text clipped - 12 lines]
>
> 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.
Tony Toews [MVP] - 29 May 2008 02:09 GMT
> 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
Signature

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/

Robert Morley - 29 May 2008 03:22 GMT
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

>> You can try Advanced
>> Access Repair at http://www.datanumen.com/aar/ This tool is rather
[quoted text clipped - 4 lines]
>
> Tony
Tony Toews [MVP] - 30 May 2008 00:43 GMT
>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
Signature

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/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.