>Hi,
>
>What would be the reason for this error message ?
>
>'The instruction at 'xxxx' referenced memory at 'xxxx'. The memory could not be read.'
>
>When users click the 'Exit' button on application they get this error message.
>
>If they do not have VFP and have only the EXE's the error message is:
>
>'ExeName.exe has generated errors and will be closed by Windows. You will need to restart the program'
>
>The code on the Exit button is:-
>
>Close databases all
>On error
>This form.release
I'm assuming that the line immediately preceding this is a typo. The proper reference would be "Thisform.release", not "This form.release".
The error you are seeing is a memory access violation, which is intercepted by the operating system, not VFP. The most frequent causes I've seen of this are dangling object references, problems with the order of release of controls in the form, and in some cases, problems releasing specific ActiveX or COM objects contained in form properties; adding explicit release code for the problem objects, native VFP controls or ActiveX/COM components as it might be, to the Release method code, followed by a DODEFAULT(), often helps the problem.
You might want to check the wiki (
http://fox.wikis.com) for discussions of dangling object references to explain and further address the problems that they create.