UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
3 Pages V  1 2 3 >  (Go to first unread post)
   Reply to this topicStart new topic
> Changing Code While Debugging, Access 2013    
 
   
projecttoday
post Feb 14 2020, 05:25 PM
Post#1


UtterAccess VIP
Posts: 11,634
Joined: 10-February 04
From: South Charleston, WV


While in debug mode if you change the code before you stop the execution of the code you run the risk of putting a phantom break point in the code. You then have to re-compile the db. I'm wondering why doesn't Access just prevent you from making changes to executing code? What am I missing or doing wrong?

--------------------
Robert Crouser
Go to the top of the page
 
pere_de_chipstic...
post Feb 14 2020, 06:17 PM
Post#2


UtterAccess Editor
Posts: 10,559
Joined: 8-November 07
From: South coast, England


Hi Robert

I've not noticed this specifically, though I've noticed that if the code stops e.g because of a compilation error in the function or sub when running, and you don't save any correction it reverts back to the original (erroring) code. As a result I always compile and save any changes before continuing to run the code.

Does recompiling cause you other problems?

--------------------
Warm regards
Bernie
Go to the top of the page
 
projecttoday
post Feb 14 2020, 06:40 PM
Post#3


UtterAccess VIP
Posts: 11,634
Joined: 10-February 04
From: South Charleston, WV


Well, problems with the recompile itself, no. I'm referring to recompiling the whole database with a command. Not a problem but certainly a nuisance and they say you should limit it's use.

--------------------
Robert Crouser
Go to the top of the page
 
pere_de_chipstic...
post Feb 14 2020, 07:02 PM
Post#4


UtterAccess Editor
Posts: 10,559
Joined: 8-November 07
From: South coast, England


Hi Robert

Yes definitely a nuisance.

I don't worry too much about compiling and I've never had a problem that I can specifically relate to compiling, also on any unhandled error, ribbon variables go out of scope and the db needs to be recompiled in any case. I do though make regular back ups which I can either revert to or import from if need be.

I'm a bit more cautious about de-compiling, and only de-compile if I get a failure compiling can't resolve or before I create an accde; again I always make a copy of the accdb first.

--------------------
Warm regards
Bernie
Go to the top of the page
 
projecttoday
post Feb 14 2020, 07:11 PM
Post#5


UtterAccess VIP
Posts: 11,634
Joined: 10-February 04
From: South Charleston, WV


I should have said decompile!

So Microsoft should not allows edits to the code while it's executing.

--------------------
Robert Crouser
Go to the top of the page
 
pere_de_chipstic...
post Feb 14 2020, 07:22 PM
Post#6


UtterAccess Editor
Posts: 10,559
Joined: 8-November 07
From: South coast, England


Ah that makes more sense! smile.gif

I'm not sure if MS should stop you editing code while executing - it does allow you to make corrections and continue rather than start again; but I do find it a bit irritating if you forget to save the change before continuing and the changes disappear pullhair.gif .

I also take the view that provided I make a backup beforehand then the number of decompiles shouldn't matter. I also have a desktop shortcut that opens Access with the decompile switch, and then select the accdb that I wish to decompile from the Access opening window which takes a little of the nuisance value away!

--------------------
Warm regards
Bernie
Go to the top of the page
 
projecttoday
post Feb 14 2020, 08:51 PM
Post#7


UtterAccess VIP
Posts: 11,634
Joined: 10-February 04
From: South Charleston, WV


At the very least a setting which allows you to choose to turn off edits to the code during execution.

What is that? Can you post it?

--------------------
Robert Crouser
Go to the top of the page
 
theDBguy
post Feb 14 2020, 10:39 PM
Post#8


UA Moderator
Posts: 77,549
Joined: 19-June 07
From: SunnySandyEggo


Hi Robert. Do I understand it correctly? Are you saying when you run into a phantom break point, you "always" have to decompile your project? I never had to do that. All I do is make a minor change in the code and then compile it again.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
FrankRuperto
post Feb 14 2020, 11:57 PM
Post#9



Posts: 664
Joined: 21-September 14
From: (MilitaryBrat) Tampa Bay, Florida, USA


Wow, what a coincidence! One of our users was experiencing these sticky ghosts earlier today. My developer setup some breakpoints for debugging some new mods and accidentally saved and C/R'd the app without first removing the breakpoints. Dev then noticed it stopping on the breakpoints when testing, removed them, saved C/R'd again, retested, all looked "Okay" and installed that version on user's box. The user then started experiencing sporadic errors when records were being saved. Dev had to re-add the same breakponts, remove them, compact/repair and repeat this cycle several times to permanently get rid of the gremlins. What's up with this?
This post has been edited by FrankRuperto: Feb 15 2020, 12:24 AM

--------------------
Currently supporting pawnbrokers that use my store management system developed with Access 2010 on Windows7. Experienced with Informix and Oracle DB's.
Go to the top of the page
 
projecttoday
post Feb 15 2020, 02:35 AM
Post#10


UtterAccess VIP
Posts: 11,634
Joined: 10-February 04
From: South Charleston, WV


Dbguy and all, what happens to me is I find myself making changes to code and then clicking on save and up pops a message that says "Saving will stop execution" at which point I think, oh no, I forgot to stop the execution before I started making the changes.

I don't want to have to redo my changes. So I save/stop.

If you don't stop the execution before your changes, that's not good. Sometimes you get a phantom breakpoint, though usually not. Who knows what else might it be doing to your effort.

If Access sent you a message BEFORE you start making the changes that would give me some peace of mind.

Frank, did you attempt a decompile in that instance?


--------------------
Robert Crouser
Go to the top of the page
 
FrankRuperto
post Feb 15 2020, 05:43 AM
Post#11



Posts: 664
Joined: 21-September 14
From: (MilitaryBrat) Tampa Bay, Florida, USA


Hi Robert,

No decompile was attempted, AFAIK. My app's developer made the mods to our user's accdb via remote desktop. Shortly after, user called me and chewed me out in Spanish. I'm not even sure our app can cleanly compile, and that's worrysome. Hearing you all agree on "Making a backup before decompiling" also worries me. I will get more info about this breakpoint incident from dev and share it here.

--------------------
Currently supporting pawnbrokers that use my store management system developed with Access 2010 on Windows7. Experienced with Informix and Oracle DB's.
Go to the top of the page
 
isladogs
post Feb 15 2020, 05:56 AM
Post#12


UtterAccess VIP
Posts: 2,188
Joined: 4-June 18
From: Somerset, UK


Agree with DBG regarded how to deal with phantom breakpoints. No decompile necessary

With regard to decompiling, I have never had any issues by using it.
I use it fairly regularly as one of my standard tool kit features
Nevertheless it is always best to backup any database before decompiling or, for that matter, compacting.

--------------------
Colin (Mendip Data Systems)
Website, email
Go to the top of the page
 
pere_de_chipstic...
post Feb 15 2020, 08:02 AM
Post#13


UtterAccess Editor
Posts: 10,559
Joined: 8-November 07
From: South coast, England


Hi Robert

QUOTE
What is that? Can you post it?


Do you mean the shortcut? It is just a shortcut with the following attibutes set:
Target: "C:\Program Files (x86)\Microsoft Office\root\Office16\MSACCESS.EXE" /decompile
Start In: "C:\Program Files (x86)\Microsoft Office\root\Office16"
(which you will need to modify for your system / version of Access).

The shortcut opens the Access EXE with the Decompile switch set. Selecting and opening a file from the 'Recent' or 'Browse to' lists decompiles that file. It means that any access db can be decompiled from a single shortcut.

hth

--------------------
Warm regards
Bernie
Go to the top of the page
 
DanielPineault
post Feb 15 2020, 09:14 AM
Post#14


UtterAccess VIP
Posts: 7,154
Joined: 30-June 11



For decompiling, ... I long ago developed https://www.devhut.net/2016/11/02/windows-e...k-context-menu/. I developed it with Access in mind, but can also be used to add such functionalities to other programs such as Excel...

As for the issue at hand, I have experienced this issue. Some versions seem more prone to it than others. I find every newer version of Access more finicky and 'unreliable' (not the right words but can't think of a better one right now). The solution is you never do any coding in debug mode. You identify the issue, then exit, and properly open the object in design mode and do your work.

--------------------
Daniel Pineault (2010-2019 Microsoft MVP, UA VIP, EE Distinguished Expert 2018)
Professional Help: https://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: https://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
GroverParkGeorge
post Feb 15 2020, 09:50 AM
Post#15


UA Admin
Posts: 36,799
Joined: 20-June 02
From: Newcastle, WA


"unpredictable", maybe?


--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
DanielPineault
post Feb 15 2020, 10:06 AM
Post#16


UtterAccess VIP
Posts: 7,154
Joined: 30-June 11



Yes, much better than my 'reliable'.

--------------------
Daniel Pineault (2010-2019 Microsoft MVP, UA VIP, EE Distinguished Expert 2018)
Professional Help: https://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: https://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
FrankRuperto
post Feb 15 2020, 10:47 AM
Post#17



Posts: 664
Joined: 21-September 14
From: (MilitaryBrat) Tampa Bay, Florida, USA


QUOTE (Colin)
Agree with DBG regarded how to deal with phantom breakpoints. No decompile necessary


Then what are they main uses, benefits and dangers with decompiling? It appears there's different scenarios causing issues when using breakpoints and different solutions offered to avoid them. DBG and Colin agree on not decompiling and making an arbitrary mod solves the problem. Daniel suggests not using breakpoints at all. My developer regularly uses breakpoints, steps into code, examines values, adds watches, etc. and rarely has issues when done, but this time was in a hurry forgot to clear all the breakpoints before saving the app.
This post has been edited by FrankRuperto: Feb 15 2020, 10:58 AM

--------------------
Currently supporting pawnbrokers that use my store management system developed with Access 2010 on Windows7. Experienced with Informix and Oracle DB's.
Go to the top of the page
 
projecttoday
post Feb 15 2020, 11:06 AM
Post#18


UtterAccess VIP
Posts: 11,634
Joined: 10-February 04
From: South Charleston, WV


Frank, I don't think Daniel is saying don't use breakpoints. I think he's saying when you hit a break point, stop the execution before you begin changing the code. (And I agree that you should do that. Problem is it just doesn't always happen.)

Has anyone noticed that this editor spell-flags "breakpoint" but doesn't spell-flag "breakpoints"?

Thanks for the links, Bernie.

--------------------
Robert Crouser
Go to the top of the page
 
GroverParkGeorge
post Feb 15 2020, 11:10 AM
Post#19


UA Admin
Posts: 36,799
Joined: 20-June 02
From: Newcastle, WA


"...but this time was in a hurry forgot to clear all the breakpoints before saving the app."

Unfortunately, there's no setting for "stopping forgetful developers". Training, perhaps, would help, but my bet would be that this experience is going to be the best teacher for that developer.

I tend not to worry so much about things like this, to be honest. I've learned that it can be dangerous to stop executing code and edit it, so I am mindful of the potential problems and try to address or avoid them. I.e. if I get antsy and edit an obvious error while in break mode, I also make sure I compile and save before moving on. It's one of those habits we develop, I guess. I have delivered an updated accdb FE with exactly this "phantom breakpoint" problem. Maybe twice, but I learned that answering the puzzled phone call was more of a problem than remembering to test everything before sending it out.


--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
DanielPineault
post Feb 15 2020, 11:22 AM
Post#20


UtterAccess VIP
Posts: 7,154
Joined: 30-June 11



QUOTE
Frank, I don't think Daniel is saying don't use breakpoints. I think he's saying when you hit a break point, stop the execution before you begin changing the code. (And I agree that you should do that. Problem is it just doesn't always happen.)

Bingo!

--------------------
Daniel Pineault (2010-2019 Microsoft MVP, UA VIP, EE Distinguished Expert 2018)
Professional Help: https://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: https://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
3 Pages V  1 2 3 >


Custom Search


RSSSearch   Top   Lo-Fi    26th February 2020 - 05:22 PM