关闭FORM窗口时有时会弹出一对话框:标题
Debugger Exception Notification
内容:
Project Project1.exe raised exception class EAccessVionlation with message 'Access violation at address 0047BAA2 in module 'Project1.exe'. Read of address 00E6422F Process stopped. Use Step or Run to Continue.
按钮
     OK    Help看CPU
View CPU Window
  TFormtt.SetWindowstate:
......看帮助文档
帮助文档:
Debugger exception notification dialog boxYou have received the following message:Project xxxx raised exception class yyyyy with message 'zzzzzz'.Process stopped.  Use Step or Run to continue.This dialog box appears when a program you're debugging raises an exception, and you have set options that instruct the debugger to handle exceptions (see the Language Exceptions, OS Exceptions pages of the Tools|Debugger options dialog). Both language exceptions and operating system exceptions show this dialog. If the 'yyyyy' in the message is a class name, it indicates that the exception is a language exception. If the 'yyyyy' is a hexadecimal value, it means that the exception is an operating system exception.If the location of the exception does not correspond to a source location, a checkbox labeled "View CPU' appears in the lower left corner of the dialog box.After pressing OK on the dialog box, the IDE shows you the location where the exception occurred. If you checked the View CPU checkbox, the CPU view is displayed. If the location of the exception corresponds directly to a source location, that source location is shown (and the View CPU checkbox does not appear on the dialog box). If the exception location does not correspond to source and you do not check the View CPU checkbox, the IDE traverses the call stack looking for a call in the stack that contains source and will show you the first call found that has source.What should you do when you see this dialog?In most cases, clicking OK and doing a Run|Run to continue will work just fine. In some cases, the state of the program will prevent you from running or continuing will not allow them to continue (you will repeatedly see the exception message). In this case, you will need to choose Run|Program Reset to end the current program run and release it from memory.Type Ctrl+C to copy this or similar messages to the clipboard.程序中是使用了一些年月日格式数据
  //下面这一句可能有问题
      //ADOQuery2.FieldByName('Timeto').AsString:=formatdatetime('yyyy-MM-dd',DateTimePicker1.DateTime);
      ADOQuery2.FieldByName('Timeto').AsDateTime:=DateTimePicker1.DateTime;
修正后,多次测试问题还存在.大家帮我也看一下

解决方案 »

  1.   

    同意hongqi看法,
    把代码都贴上来,问题点好象不在这里.是读取了受保护的内存区域造成的.
      

  2.   

    以上回答问题者都是高手!!!但水平更高者要算是hongqi162(失踪的月亮)
    经过我的正反对比,在月亮大侠的提醒下,我对程序作了一些改进,改进后测试再也没有出现类似问题,测试至少100次以上.
    不但DELPHI如此 C++也有如此的问题,我到网上查了"Debugger Exception Notification"不管如何,先结贴再说,这是我的习惯,希望以后大家多多关注我,哈哈