我用tdbedit同表的某个时间字段关联起来。
我想当输入错误数据后,能在tdbedit在向query更新以前处理可能的错误事件。
TDBEdit关联有一个字段,在数据集的字段编辑器中选中此字段,然后,查看其事件,我用的是onvalidate事件处理过程,但无论怎样,系统数据库错误都会出现,
而我的onvalidate处理过程并没有执行到。
而根据帮助文档:Write an OnValidate event handler to validate changes made to the data in the field, just before the data is written to the current record buffer
郁闷啊,各位有什么解决方法啊
我想当输入错误数据后,能在tdbedit在向query更新以前处理可能的错误事件。
TDBEdit关联有一个字段,在数据集的字段编辑器中选中此字段,然后,查看其事件,我用的是onvalidate事件处理过程,但无论怎样,系统数据库错误都会出现,
而我的onvalidate处理过程并没有执行到。
而根据帮助文档:Write an OnValidate event handler to validate changes made to the data in the field, just before the data is written to the current record buffer
郁闷啊,各位有什么解决方法啊
try
(先做数据转换)
except
(错误提示)
exit;
end;
query更新
或在AfterEdit或Beforepost事件中判断也可以。
我觉得用befortpost是可以的,但我发现这个事件根本不被调用。
现象描述:
调试时,在代表时间字段的tdbedit(name=mytime)控件里输入66,只要焦点一离开该控件
就出现'66 is not a valid date and time',至于beforepost, beforeupdate, onvalidate, onposterror, onupdateerror等所有我能想到的能够对错误数据处理的地方
都插入提示语句,就是没有一条执行,老是出现系统提示错误。