Access project needs to close error

G

Guest

I have an Access Data Project (adp) that is running against an SQL Server
2000 database using the OLEDB provider. I am currently developing it so I
frequently change the code and recompile. After some undetermined amount of
time passes I get the "Access has encountered and error and needs to close"
message when I attempt to open a code module in the VBA editor.

Compact and repair does not resolve the problem. The only fix that has
worked is to open a new project file and import my project's forms, reports
and modules into it from the original.

Has anyone else experienced this?

All help appreciated,
-Kriosa
 
S

Sylvain Lafontaine

Since WinXP Sp2, this happens frequently with either Access 2000 or 2002.
I've also heard of this with A2003 on Win2003 Server.

Beside the version of Access, another thing to check would be to make sure
to never use the function Me.RecordsetClone and use Me.Recordset.Clone
instead.

Any heavy use of BIT fields in your code?
 
G

Guest

Sylvain,

Thanks for your response. The project is Access 2003. I don't really use
either me.recordsetclone or bits in the db design.

Currently I suspect that it may be corrupting because I tend to edit my code
in debugger break mode. I understand that is a No No. So I'll try and mend
my ways and see if this improve the situation.

-Kathryn
 
R

Robert Morley

Editing in debug mode is a fairly common cause of problems in Access. Try
decompiling your Access project and see if that gets rid of the problem. To
decompile a project, type the following from a command line or from the
Start/Run dialogue (substituting where necessary, of course):

"<full path to msaccess.exe>" /decompile "<full path to ADP file"



Rob
 
R

Robert Morley

Woops...missed the closing angle-bracket/greater-than-sign on that...

"<full path to msaccess.exe>" /decompile "<full path to ADP file>"

Oh, and when you substitute the correct file names into the above, DO type
the quotes, DON'T type the angle-brackets.



Rob
 
V

Vayse

I never knew that editing in debug mode caused problems. Hmm, explains a
lot.
Though it is very handy to edit that way.
 
G

Guest

Thanks for the reply. I had already tried the /decompile switch.
Unfortunately that did not solve my inability to get to the code in my
project.

To date the only solution is to import all the objects into a new project
container. This leads me to suspect that it is the project container that is
somehow corrupted.

-Kathryn
 
R

Robert Morley

Yes, I do to. I also decompile on a regular basis to counteract the
problem. You'll occasionally see similar problems in a VB6 project (on
which VBA is based) when running from the IDE and editing at the same time,
though for those, all you have to do is go out of VB6 and back in.



Rob
 
V

Vayse

I do decompile regularly, but until now I didn't know WHY I had to decompile
regularly!
 

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