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

Invisible breakpoint

P: 33
My application has a startup script that calls a certain query. This query calls a function called fGetUserID(). I don't think that the specific code is relevant to the question. My problem is that every time I start the application, it hits a breakpoint the moment it hits fGetUserID(), but this breakpoint only exists the first time fGetUserID() is called by the application, and then the breakpoint ceases to exist.

It is also worth pointing out that after the breakpoint is hit, I notice that Debug -> Compile Corrected is not greyed out. If I just hit F5 then the program continues normally, and everything happens correctly, and the Compile Corrected is greyed out the next time I look.

There are no compiler errors in that function. Also, I have already tried Debug->Clear All Breakpoints.

Sandro
Nov 24 '06 #1
Share this Question
Share on Google+
4 Replies


NeoPa
Expert Mod 15k+
P: 31,186
From your terminology this doesn't sound like Access (startup script rather than a form etc).
However, I've noticed this sort of behaviour in Access and Excel from time to time. It remembers the last state it was in when editing (Why?!? - MS).
To get around this, I normally :
1. Open the application with the (SHIFT) bypass key (to stop any code running).
2. Make a small, self-cancelling, change to the code.
3. Debug / Compile the project.
4. Close any code windows I don't want to see.
5. Alt-F11 to return to application.
6. Close and Save.

This works for me - Good luck.
Nov 24 '06 #2

P: 33
Thank you, it worked.... Logically I don't understand why this is the case, but at least I know what to do next time.
Nov 24 '06 #3

NeoPa
Expert Mod 15k+
P: 31,186
Nor do I Sandro, nor do I.
However, I suspect that it's to do with MS Code storing things which are logically session related (breakpoints etc) in with the project data itself.

We don't write the code - we just have to find ways around it when it's like that.
Nov 24 '06 #4

MMcCarthy
Expert Mod 10K+
P: 14,534
Nor do I Sandro, nor do I.
However, I suspect that it's to do with MS Code storing things which are logically session related (breakpoints etc) in with the project data itself.

We don't write the code - we just have to find ways around it when it's like that.
This can happen in a access database when the application is not closed out correctly. It can also cause corruption. The solution is to have a hidden form opened at database startup and force a application quit procedure to be preformed when the form unloads. So even if the user tries to close the application using the 'x' button the unload event will be preformed anyway.

Don't forget access holds everything in memory unless a compact and repair is done. Therefore make sure all recordsets and database objects are correctly closed and set to nothing. It's probably also a good idea to check any global variables set to static or constants.


Mary
Nov 25 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.