Access crashes when breakpoint is removed.

U

UnderGround

Hi All,
I have a problem that i cannot figure out. I have a report that runs
when you press a button. It was working fine now all of a sudden then
the button is pressed the database crashes and closes down. I kept a
breakpoint on the button clicked event. now when i click the button and
go into debug mode the report opens and prints out and works fine. As
soon as i remove the breakpoint and run it it crashes. I managed to fix
it once by doing a number of things i compacted and repaired (which
dint dix it) then i took a fresh copy of the data base and kept a
breakpoint ran the report once then saved it took the breakpoint out.
saved it compacted and repaired then ran it normally and it ran without
problem. Now after a few days it has happened again and none of the
things i do is fixing it. If i run with a breakpoint it runs if i
remove it it crashes.
any ideas ???

Thanks
 
D

Dirk Goldgar

UnderGround said:
Hi All,
I have a problem that i cannot figure out. I have a report that runs
when you press a button. It was working fine now all of a sudden then
the button is pressed the database crashes and closes down. I kept a
breakpoint on the button clicked event. now when i click the button
and go into debug mode the report opens and prints out and works
fine. As soon as i remove the breakpoint and run it it crashes. I
managed to fix it once by doing a number of things i compacted and
repaired (which dint dix it) then i took a fresh copy of the data
base and kept a breakpoint ran the report once then saved it took the
breakpoint out. saved it compacted and repaired then ran it normally
and it ran without problem. Now after a few days it has happened
again and none of the things i do is fixing it. If i run with a
breakpoint it runs if i remove it it crashes.
any ideas ???

Try decompiling the database and see if the problem goes away. First,
use Debug -> Clear All Breakpoints to remove all breakpoints. Then
follow these steps:

1. With the database closed -- no users in it at all -- and (ideally)
Access not running, make a backup copy.

2. On the task bar, click Start -> Run...

3. Enter this (adapted to match your database path and name) in the Run
dialog box and click OK:

msaccess.exe /decompile "C:\My Documents\YourDBName.mdb"

You may need to include the full path to msaccess.exe, but I don't find
that to be the case when I try it. Depending on your Access version,
you may not get any sign that anything in particular happened. Your
database will probably open in Access.

4. Compact and Repair your database.

5. Open the database again, press Alt+F11 to switch to the VB Editor,
and click Debug -> Compile (your project). If any errors appear, fix
them and recompile.

6. Close the VB Editor. Compact & Repair again.

See if the problem has disappeared.
 
D

Dirk Goldgar

Dirk Goldgar said:
Try decompiling the database and see if the problem goes away.

If that doesn't work, your best bet may be to import all the objects
into a new database.

To avoid code corruption, try never to modify code in an object that is
open in other than design view. For example, don't modify code behind
forms when their open in form view. I'm not saying you do that, but in
my experience that's what causes most problems of this sort.
 
U

UnderGround

Thanks Alot Dirk.
I tried the things you said about decompiling and it worked like a
charms. I have not heard of any issues from the users after that.
Thanks.
 

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