472,354 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 software developers and data experts.

Best way to repair corrupted VBA code module?

Well, it has finally happened. We have a five year old app that is
widely distributed. I cannot get an update done because none of the
code modules will open. Access complains that the module is corrupt
or that it cannot be read from a network drive. They are not ON a
network drive.

Anyone have a clue how to repair this?

All help much appreciated.
Nov 13 '05 #1
14 25338

Forgot to mention -- it's an A2K app.
On Fri, 08 Apr 2005 01:47:50 -0500, Lauren Wilson
<pr*****@private.com> wrote:
Well, it has finally happened. We have a five year old app that is
widely distributed. I cannot get an update done because none of the
code modules will open. Access complains that the module is corrupt
or that it cannot be read from a network drive. They are not ON a
network drive.

Anyone have a clue how to repair this?

All help much appreciated.


Nov 13 '05 #2
Lauren Wilson wrote:
Forgot to mention -- it's an A2K app.
On Fri, 08 Apr 2005 01:47:50 -0500, Lauren Wilson
<pr*****@private.com> wrote:

Well, it has finally happened. We have a five year old app that is
widely distributed. I cannot get an update done because none of the
code modules will open. Access complains that the module is corrupt
or that it cannot be read from a network drive. They are not ON a
network drive.

Anyone have a clue how to repair this?

All help much appreciated.


Did you recently install a newer Office component? Here is a couple of
leads?

http://support.microsoft.com/default...b;en-us;304548
http://support.microsoft.com/default...b;en-us;326605

--
'---------------
'John Mishefske
'---------------
Nov 13 '05 #3
Rog
3 options:
- Tools/Database utilities/Repair database - but I guess you already
tried that.
- Decompile: start Access with the decompile switch, e.g.
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" /decompile
then open the database and recompile it.
- If that doesn't work, create a new database and import everything.

Nov 13 '05 #4
On Fri, 08 Apr 2005 01:47:50 -0500, Lauren Wilson <pr*****@private.com> wrote:
Well, it has finally happened. We have a five year old app that is
widely distributed. I cannot get an update done because none of the
code modules will open. Access complains that the module is corrupt
or that it cannot be read from a network drive. They are not ON a
network drive.

Anyone have a clue how to repair this?

All help much appreciated.


First step - make a new copy of the file before each repair attempt, so you
don't make thigs worse.

Second step - try decompiling the application. To do this, first make sure
all start-up actions are disabled, then open access with the path of the
database file as the first argument, and /decompile as the next argument.

There's about a 50/50 chance that will fix it for you. If not...

I was able to work around a problem like what you describe once, but I can't
guarantee the solution will work for you.

What worked for me was to open a new Access database, and import objects one
at a time from the corrupted one (one object could not be imported and had to
be recreated from an older copy). They were still corrupted, but so long as I
didn't try to save changes, compile, or run anything, I could open the modules
and copy the code out as text.

After copying out the code text and saving it in text files, the next step was
to open yet another new Access database, import just the forms and reports
from the corrupted database (except the totally trashed one), and delete their
modules by changing their Has Module properties to No and saving them.
Finally, I manually pasted the code back in.
Nov 13 '05 #5
Rog wrote:
3 options:
- Tools/Database utilities/Repair database - but I guess you already
tried that.
- Decompile: start Access with the decompile switch, e.g.
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" /decompile
then open the database and recompile it.
- If that doesn't work, create a new database and import everything.

One additional option; restore from backup.

--
'---------------
'John Mishefske
'---------------
Nov 13 '05 #6
On 8 Apr 2005 00:05:46 -0700, "Rog" <ro************@hotmail.com> wrote:
3 options:
- Tools/Database utilities/Repair database - but I guess you already
tried that.
- Decompile: start Access with the decompile switch, e.g.
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" /decompile
then open the database and recompile it.
- If that doesn't work, create a new database and import everything.


When decompile doesn't work, importing objects doesn't usually work either.
The corruption either prevents importing or results in the corruption being
imported with the objects.

If the import works at all, though, it can sometimes help to import the
objects, then imediately do a decompile. Even then, it's likely you'll need
to delete all or many of the modules, and re-create them by pasting the text
back in, or the corruption will reappear after the next compact.
Nov 13 '05 #7
Lauren Wilson wrote:
Well, it has finally happened. We have a five year old app that is
widely distributed. I cannot get an update done because none of the
code modules will open. Access complains that the module is corrupt
or that it cannot be read from a network drive. They are not ON a
network drive.

Anyone have a clue how to repair this?

All help much appreciated.

Well, I've had about the same problem, only that Access Crashed whenever
I wanted to open a module or the Visual Basic Editor.
I solved it by going to the Modules tab, there I clicked on New Module.
Then the Visual Basic Editor popped up. Then I saved the project
(without saving, it didn't work), closed Access and reopened it. Finally
i deleted the new Module.

Olivié
Nov 13 '05 #8
On Fri, 08 Apr 2005 02:04:05 -0500, John Mishefske
<mi************@JUNKtds.net> wrote:
Lauren Wilson wrote:
Forgot to mention -- it's an A2K app.
On Fri, 08 Apr 2005 01:47:50 -0500, Lauren Wilson
<pr*****@private.com> wrote:

Well, it has finally happened. We have a five year old app that is
widely distributed. I cannot get an update done because none of the
code modules will open. Access complains that the module is corrupt
or that it cannot be read from a network drive. They are not ON a
network drive.

Anyone have a clue how to repair this?

All help much appreciated.


Did you recently install a newer Office component? Here is a couple of
leads?

http://support.microsoft.com/default...b;en-us;304548
http://support.microsoft.com/default...b;en-us;326605


Thanks a LOT John.

The 2nd article above has this portion:

"CAUSE
You may receive one of these error messages when both Microsoft Access
2000 and version 6.3.91.8 of the Vbe6.dll file are installed on the
computer, and either of the following conditions is true: • You
imported forms or reports that contain code modules or standalone
modules into a new Microsoft Access 2000 database by using Microsoft
Access 2000.
• You copied and pasted forms or reports that contain code modules or
standalone modules into the Microsoft Access 2000 database by using
Microsoft Access 2000.
Then, you close and reopen the database and try to view, execute, or
compile the code."

This is pretty much what happened. I wonder what that file:
"Vbe6.dll" is for? Is that the VBA for extensibility DLL?

What a mess. I have a lot of code to copy and paste into a new
database.
Nov 13 '05 #9
Lauren,
I've had this same issue dozens of times with A2k and it used to scare
me to death. I'm guessing you are developing in Ac2002. If so try
converting the database to ac2002 and then converting the new one back.
It always works for me.
HTH
Pachydermitis

Nov 13 '05 #10
On 8 Apr 2005 07:56:10 -0700, de******@hotmail.com wrote:
Lauren,
I've had this same issue dozens of times with A2k and it used to scare
me to death. I'm guessing you are developing in Ac2002. If so try
converting the database to ac2002 and then converting the new one back.
It always works for me.
HTH
Pachydermitis


Actually, I'm sorry to say, I'm still locked into A2K -- primarily
because most of my users are still on A2K full or runtime.

I WANT to jump to Access 2003 but I am unclear about what impact that
will have on my users and have not had the time to investigate it in
detail.
Nov 13 '05 #11
If you have office 2002/3 installed somewhere, use that to convert the
db to 2002/3. Then convert it back to 2000 (free of corruption we
hope) for your users

Nov 13 '05 #12
Steve Jorgensen <no****@nospam.nospam> wrote in
news:66********************************@4ax.com:
On 8 Apr 2005 00:05:46 -0700, "Rog" <ro************@hotmail.com>
wrote:
3 options:
- Tools/Database utilities/Repair database - but I guess you
already tried that.
- Decompile: start Access with the decompile switch, e.g.
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE"
/decompile then open the database and recompile it.
- If that doesn't work, create a new database and import
everything.


When decompile doesn't work, importing objects doesn't usually
work either. The corruption either prevents importing or results
in the corruption being imported with the objects.

If the import works at all, though, it can sometimes help to
import the objects, then imediately do a decompile. Even then,
it's likely you'll need to delete all or many of the modules, and
re-create them by pasting the text back in, or the corruption will
reappear after the next compact.


If it's the VB dll error, it's hosed and unrecoverable, no?

In any event, you should at least try SaveAsText, which will show
you if the code is actually still there or not. I recently saved a
form where the VBA code window wouldn't open, but SaveAsText could
still extract the code.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #13
On Fri, 08 Apr 2005 19:10:46 GMT, "David W. Fenton"
<dX********@bway.net.invalid> wrote:
Steve Jorgensen <no****@nospam.nospam> wrote in
news:66********************************@4ax.com :
On 8 Apr 2005 00:05:46 -0700, "Rog" <ro************@hotmail.com>
wrote:
3 options:
- Tools/Database utilities/Repair database - but I guess you
already tried that.
- Decompile: start Access with the decompile switch, e.g.
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE"
/decompile then open the database and recompile it.
- If that doesn't work, create a new database and import
everything.


When decompile doesn't work, importing objects doesn't usually
work either. The corruption either prevents importing or results
in the corruption being imported with the objects.

If the import works at all, though, it can sometimes help to
import the objects, then imediately do a decompile. Even then,
it's likely you'll need to delete all or many of the modules, and
re-create them by pasting the text back in, or the corruption will
reappear after the next compact.


If it's the VB dll error, it's hosed and unrecoverable, no?

In any event, you should at least try SaveAsText, which will show
you if the code is actually still there or not. I recently saved a
form where the VBA code window wouldn't open, but SaveAsText could
still extract the code.


It can be a mighty struggle sometimes, but I can't remember a time I wasn't
able to recover all but one or 2 code modules if I had to. Of course, the
recovery may not be worth the hassle, particularly if good backups have been
done (obviously, I've worked with some people who didn't do that).
Nov 13 '05 #14
Steve Jorgensen <no****@nospam.nospam> wrote in
news:4b********************************@4ax.com:
On Fri, 08 Apr 2005 19:10:46 GMT, "David W. Fenton"
<dX********@bway.net.invalid> wrote:
Steve Jorgensen <no****@nospam.nospam> wrote in
news:66********************************@4ax.co m:
On 8 Apr 2005 00:05:46 -0700, "Rog" <ro************@hotmail.com>
wrote:

3 options:
- Tools/Database utilities/Repair database - but I guess you
already tried that.
- Decompile: start Access with the decompile switch, e.g.
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE"
/decompile then open the database and recompile it.
- If that doesn't work, create a new database and import
everything.

When decompile doesn't work, importing objects doesn't usually
work either. The corruption either prevents importing or results
in the corruption being imported with the objects.

If the import works at all, though, it can sometimes help to
import the objects, then imediately do a decompile. Even then,
it's likely you'll need to delete all or many of the modules,
and re-create them by pasting the text back in, or the
corruption will reappear after the next compact.


If it's the VB dll error, it's hosed and unrecoverable, no?

In any event, you should at least try SaveAsText, which will show
you if the code is actually still there or not. I recently saved a
form where the VBA code window wouldn't open, but SaveAsText could
still extract the code.


It can be a mighty struggle sometimes, but I can't remember a time
I wasn't able to recover all but one or 2 code modules if I had
to. Of course, the recovery may not be worth the hassle,
particularly if good backups have been done (obviously, I've
worked with some people who didn't do that).


Well, it depends on how recent your backups are. Losing 4 hours of
work is not as bad as losing the whole project, but it's still a
pretty severe problem.

In the case I was alluding to, it was a new form with newly-written
code, and there was no backup (it corrupted in the same session in
which it was created). It was complex enough that it was worth doing
some extra work to try to recover, though it wouldn't have been a
huge problem to recreate from scratch.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Justin Koivisto | last post by:
OK, here's one of the rare times where I call out to all of you. ;) I need to implement a promotional discount code module into osCommerce 2.2...
4
by: Ram | last post by:
I have a code module with main as subroutine name. How to launch a Windows form from here. Thanks, Ram
1
by: Thomas Heller | last post by:
I'm using the code module to implement an interactive interpreter console in a GUI application, the interpreter running in a separate thread. To...
2
by: Thelma Lubkin | last post by:
I do a lot of my code writing for Access forms at home, where I have no access to Access. While in Access, I export the entire primary code...
3
by: Salad | last post by:
I'm asking this for curiosity's sake. Is there a code module size limit? I looked at Access Specifications in help and didn't notice a code limit...
10
by: =?Utf-8?B?R3JlZw==?= | last post by:
I have the following three files. 1. Users.aspx is a webpage that uses the <asp:ObjectDataSourcecontrol to populate a simple <asp:ListBoxcontrol....
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.