delphi2007 教程

delphi2007 教程

首页 新随笔 联系 聚合 管理
  1013 Posts :: 0 Stories :: 28 Comments :: 0 Trackbacks
程序执行的一些漏洞,错误如何避免? VCL组件开发及应用
http://www.delphi2007.net/DelphiVCL/html/delphi_20061221184952209.html
在程序运行时,经常因为程序员考虑不全面,而导致一些错误,但程序员却在设计期没有发现,例如:  
  在没有选中记录的时候却点击删除,会出现以下错误提示,,  
  projict   projict2.exe   raised   exception   class   edatabaseerrow   with   message'adoquery1:cannot   perform   this   operation   on   an   empty   dataset'.processstoped.use   step   or   run   to   contiune.  
                                          ok               help    
  储如此类错误如何避免,只要能使程序在运行过程中不会因为设计期的疏忽而中止跳出就行,大家一起探讨一下?

try..except..end   捕获异常情况,应该可以吧

这是基本的出错处理,如果没有记录就不允许点击删除.

posted on 2009-01-04 16:53 delphi2007 阅读(105) 评论(0)  编辑 收藏 引用
只有注册用户登录后才能发表评论。