By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,667 Members | 2,611 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,667 IT Pros & Developers. It's quick & easy.

The visual basic for Applications project in the database is corrupt

P: n/a
Hi,
Access 2003. Running over terminal server on a Windows Server 2003 box.
The error occurs on every machine that I've tried copying the file to.
Latest Jet SP & Office SP. Database hasn't been converted. A mixture of
modules, forms, linking tables & temp. tables at the access end.
Exporting to a new database doesn't work (same error). Importing from a
new database doesn't work (same error). Trying to open any form or module in
code view is impossible (same error). Permission are set at
HKLM/Soft.../Micros.../Office/XX [version] for everyone to full control.

Can anyone help? I'm not fussed about the data - but we spent two full
days and nights work on code modules- and made no record of the development
process. I'd love to get that work back if possible.

- Good "de-corruption" tool?
- Any way of getting to the code (splitting the vb parts out of the
mdb?)

We haven't backed up the database recently enough to merely roll
back. Yes - it is our own fault. We'll be backing up daily rather than twice
weekly now.

Thanks,

Nick Stansbury
Analyst, Sage Partners

Nov 13 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
On Jul 15 2004, 05:57 am, "Nick Stansbury" <nickDOTstansbury@sage-
partners.com> wrote in news:cd**********@phys-news-1.nl.colt.net:
- Any way of getting to the code (splitting the vb parts out of the
mdb?)


Did you try SaveAsText? If that fails, which I think is likely, try
pksolutions.com.

--
remove a 9 to reply by email
Nov 13 '05 #2

P: n/a
In message <cd**********@phys-news-1.nl.colt.net>, Nick Stansbury
<ni**************@sage-partners.com> writes
Hi,
Access 2003. Running over terminal server on a Windows Server 2003 box.
The error occurs on every machine that I've tried copying the file to.


That could be a bogus error message. I remember seeing it when I was
moving A2000 databases around a few years ago. IIRC it meant that one of
the linked tables referenced in a query couldn't be opened because there
was no DSN on the machine the file had been moved to. It was nothing at
all to do with VBA.

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author. Will work for money.

Nov 13 '05 #3

P: n/a
Did you try SaveAsText? If that fails, which I think is likely, try
pksolutions.com.


SaveAsText? Not being an access guy I'm a bit lost - how can I run any vb
routines without being able to get into the VB editor?
Nov 13 '05 #4

P: n/a
In message <zm**************@shrdlu.com>, Bernard Peek <ba*@shrdlu.com>
writes
In message <cd**********@phys-news-1.nl.colt.net>, Nick Stansbury
<ni**************@sage-partners.com> writes
Hi,
Access 2003. Running over terminal server on a Windows Server 2003 box.
The error occurs on every machine that I've tried copying the file to.


That could be a bogus error message. I remember seeing it when I was
moving A2000 databases around a few years ago. IIRC it meant that one
of the linked tables referenced in a query couldn't be opened because
there was no DSN on the machine the file had been moved to. It was
nothing at all to do with VBA.


I'm not working for that company any more so I can't refer to my notes
at the time. but more of the details are coming back to me.

The problem was that there was a form in the database that couldn't open
its data source because the source used a linked database that was not
available.

I would start by creating a clean database and importing or re-creating
the tables and queries in it. Verify that each table can be opened, fix
any that can't. If you can open all of the tables and queries then the
problem is something else.

Once all of the tables are fixed you should be able to import the forms
and open them, unless there's a completely different reason for the
error message.

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author. Will work for money.

Nov 13 '05 #5

P: n/a
"Nick Stansbury" <ni**************@sage-partners.com> wrote:
- Good "de-corruption" tool?


Decompile is the only thing I know of.

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
Nov 13 '05 #6

P: n/a
"Nick Stansbury" <ni**************@sage-partners.com> wrote:
Did you try SaveAsText? If that fails, which I think is likely, try
pksolutions.com.


SaveAsText? Not being an access guy I'm a bit lost - how can I run any vb
routines without being able to get into the VB editor?


Good point. Actually excellent point. You can't reference a utilities MDB as
that's buried in the VBA editor.

I was going to post the following but ignore it now.

The undocumented SaveAsText and LoadFromText may help if an object is corrupted or
otherwise behaving weirdly.
At the debug/immediate window type:
Application.SaveAsText acForm,"MyForm","c:\form.txt
You can load the file into a new MDB.
Application.LoadFromText acForm,"MyForm","c:\from.txt"

Sample code at http://www.datastrat.com/Code/DocDatabase.txt

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
Nov 13 '05 #7

P: n/a
"Nick Stansbury" <ni**************@sage-partners.com> wrote:
Access 2003. Running over terminal server on a Windows Server 2003 box.
The error occurs on every machine that I've tried copying the file to.
Latest Jet SP & Office SP. Database hasn't been converted. A mixture of
modules, forms, linking tables & temp. tables at the access end.


This may sound odd but the same message is displayed if it's an MDE in A2003 format
and you try to run it in A2002. Now I doubt very much it's an MDE and you are trying
to open it in A2002 as your posting sounds reasonably competent.

I'm not quite sure why I'm mentioning this even but oh well.

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
Nov 13 '05 #8

P: n/a
Tony Toews <tt****@telusplanet.net> wrote in
news:81********************************@4ax.com:
"Nick Stansbury" <ni**************@sage-partners.com> wrote:
Access 2003. Running over terminal server on a Windows Server
2003 box.
The error occurs on every machine that I've tried copying the file
to. Latest Jet SP & Office SP. Database hasn't been converted. A
mixture of modules, forms, linking tables & temp. tables at the
access end.


This may sound odd but the same message is displayed if it's an
MDE in A2003 format and you try to run it in A2002. Now I doubt
very much it's an MDE and you are trying to open it in A2002 as
your posting sounds reasonably competent.

I'm not quite sure why I'm mentioning this even but oh well.


It's an erroneous error message, and you have just documented for
the Google Groups archive that it is, in fact, an error. Your post
could someday save someone some work.

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

P: n/a
On Jul 15 2004, 08:31 am, "Nick Stansbury" <nickDOTstansbury@sage-
partners.com> wrote in news:cd**********@phys-news-1.nl.colt.net:
Did you try SaveAsText? If that fails, which I think is likely, try
pksolutions.com.


SaveAsText? Not being an access guy I'm a bit lost - how can I run any vb
routines without being able to get into the VB editor?


Can you get into the Debug window? Try Ctrl+G. If that works, in the Debug
window type

Application.SaveAsText acForm, "formname", "path_to_file"

If that works, repeat for all modules in the database, then load them into
a new database using LoadFromText with similar syntax.

In fact, you may try the Objects as Text add-in from
http://www.users.cloud9.net/~dfurman/code.htm, which provides a GUI for the
above.

If you cannot get into the Debug window, then another option would be to
open the database in an instance of Access via automation and use
SaveAsText on that instance, to avoid loading the corrupt project in the
VBE. Post back if you need details on how to do that.

As Tony said, decompile is worth a try too.

--
remove a 9 to reply by email
Nov 13 '05 #10

P: n/a
For purposes of completeness & for any poor soul that tries to track this
one down through google groups at a later date I thought I'd post a follow
up report.

Having tried all of the suggested solutions posted by the various kind souls
who suggested them, we were unable to make anything work. The corruption ran
so deep that absolutely nothing would work - we couldn't even open an
immediate debug window - it just produced the same error.

None of the commercial data recovery firms that we approached could help -
they couldn't get to the vb code. None of the commercial tools tried worked
either.

Lessons learnt - twofold - 1) Don't hit C+Alt+Del when an access form is
running. Ever! especially not when it is in the middle of a for each loop!
2) Backup. Backup. Backup. Then, er; backup.

If anyone ever discovers a solution to this do post it up here - I'd love to
know how it got fixed.

Nick



Nov 13 '05 #11

P: n/a
"Nick Stansbury" <ni**************@sage-partners.com> wrote in
news:cd**********@phys-news-1.nl.colt.net:
None of the commercial data recovery firms that we approached
could help - they couldn't get to the vb code. None of the
commercial tools tried worked either.
Did you try Peter Miller of PKSolutions?
Lessons learnt - twofold - 1) Don't hit C+Alt+Del when an access
form is running. Ever! especially not when it is in the middle of
a for each loop!
Why not Ctrl-Break? In nearly all cases, that stops the code (though
it may take time to show up).
2) Backup. Backup. Backup. Then, er; backup.


Multiple redundant backups is a given. I have seen way too many
situations where two different backup methods failed at the same
time.

And, of course, be sure to test regularly that your backups can be
restored from.

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

P: n/a
Dimitri Furman <df*****@cloud99.net> wrote:
In fact, you may try the Objects as Text add-in from
http://www.users.cloud9.net/~dfurman/code.htm, which provides a GUI for the
above.


Added to my forms corruption page.

Thanks, 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
Nov 13 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.