Attempted to read or write protected memory.
"Attempted to read or write protected memory. This is often an indication that other memory is corrupt." I got this problem in my project when I ran exe from release in other pc running in windows 10. It's perfectly works on my pc running in windows 7 and try on other OS like windows 8 with no problem. I can't figure out what was happening so I troubleshoot the compatibility and I set the target CPU on x86 but with no luck. This problem happens randomly, sometimes it works fine then sometimes got this problem again. I used ms access .accdb database and a crystal report. I can't show some code because it's bunch of them. I hope there's a solution, anything that can help is highly appreciated. Thanks in advance!
Re: Attempted to read or write protected memory.
You need to try and narrow down where the error may be occurring. Based on the info given it is not possible to do anything more than take a wild guess so not much point it that. Also have no clear idea what you mean by randomly. Could be that you do the exact same thing 3 times and it happens once at the beginning, a different time at the end and the 3rd time works fine or it could mean that you are doing something completely different everytime and it may occur at any point during operation maybe while trying to login or running a report or closing the program. More likely it happens when a specific order of events happen or specific data is present.
Bottom line is that more detailed info about what is going on is required.