Occurs just before the data is written to the record buffer.

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. The EditMask property allows validation of the data on a character by character basis while it is being entered by the user. OnValidate allows an application to validate the data as a whole.

When the value of a field component is assigned programmatically, validation by the EditMask is bypassed, since there is no data-aware control to enforce adherence to the mask. OnValidate allows an application to validate such data before it is posted to the database table.

To reject the current value of the field from the OnValidate event handler, raise an exception.

When writing the value of a field to the current record buffer, the following steps occur:

1 The OnValidate event handler is called to validate the data. 
2 If the OnValidate event handler does not raise an exception, the data is written to the current record buffer. 
3 If writing the data does not raise an exception, the OnChange event handler is called to allow a response to the change.

TField OnValidate 事件的更多相关文章

  1. delphi中adoquery控件中某个字段Onvalidate事件的用法?

    procedure TForm2.ADOQuery1TestFieldValidate(Sender: TField);begin// Sender就是当前字段,可以在这里对Sender字段进行各种操 ...

  2. TkbmMWClientQuery的计算字段在CalcFields事件触发次数太多

    kbmmw有两处BUG和作者提下,一个是TkbmMWClientQuery的计算字段在CalcFields事件触发次数太多,另一个是在TkbmMemTable的加载数据时字段会执行OnValidate ...

  3. Delphi 在dbgrideh中表格输入数据时有效性的检查(转)

    在数据库系统设计中经常要用到在表格中进行数据录入,如何判断在数据导入时的数据有效性呢?下面介绍几种常用的方法与大家交流. 方法一:Dbgrid是与Table,在Table的Column的OnSetTe ...

  4. DXDBGrid使用方法

    http://www.cnblogs.com/gtsup/archive/2012/08/28/2660197.html dxDBGrid使用集锦   转载自:http://hi.baidu.com/ ...

  5. jQuery EasyUI 1.4更新记录

    问题: menu:修复当删除一个menu项时.menu高度不准确. datagrid:修复当datagrid宽度太小时,fitColumns方法不能使用. 改进: 1.为easyui全部组件新增了自适 ...

  6. JNI详解---从不懂到理解

    转载:https://blog.csdn.net/hui12581/article/details/44832651 Chap1:JNI完全手册... 3 Chap2:JNI-百度百科... 11 C ...

  7. query中对应的OnSetText和onGetText事件

    今天在看代码的时候遇到一个问题,query中的某个字段和在表中显示的不是一个值,我觉得很奇怪,于是找了很久,才知道为什么,原来是query中的OnSetText和onGetText事件在作怪,经过一番 ...

  8. delphi7中 OnDrawColumnCell 事件怎么用

    你问的这个事件应该是dbgrid控件中的吧?这个事件是在grid控件载入数据的时候触发的,至于你这个“怎么用”波及的范围太大了,呵呵!不知道如何说起!另外还是发一段相关的代码吧,这也是我之前提过问题, ...

  9. TField中的GetText和SetText

    在数据表中的某些字段出于性能或数据规范化的考虑,会用组编号代替,就像学生有学号,员工有员工ID一样,但我们看的时候如果直接输入这样的编号看的人可能就会头痛了,这时就可用TField中的GetText转 ...

随机推荐

  1. 6.oop-类和对象

    一.如何抽象对象1.创建一个类2.给该描述属性 属性就是java中所有的数据类型3.给该类定义行为方法 方法的签名是:public void 方法名(){方法体} 公共的 无返回类型 二.如何使用类和 ...

  2. Android自动化测试学习路线

    最近在整理Android自动化测试的相关资料,大体上把一些知识点梳理了,这里做一个简单的分享! Android里面测试相关的工具和框架太多了.你应该从以下几个方面入手. 编程语言的选择 如果你要学习的 ...

  3. 用ASP.NET MVC仿站糗事百科

    废话就不多说,直接来操作,有些细节问题就不一一解说了(没有几天几夜都说不完),主意是想让大家看完知道大概这个框架是怎么搭建的就可以了 一. 新建一个解决方案,搭建三层架构,分别为: DAL层  .DL ...

  4. face recognition[MobileFaceNet]

    本文来自<MobileFaceNets: Efficient CNNs for Accurate Real-Time Face Verification on Mobile Devices> ...

  5. 一:Neutron实现网络虚拟化

    一 云计算时代数据中心物理网络的问题 数据中心虚拟化成为了趋势,最典型的场景莫过于:对数据中心的服务器进行虚拟化,来提高资源利用率,同时降低单位能耗. 但是,随着数据中心虚拟化程度的不断提高.虚拟化服 ...

  6. PHP之基本操作

    PHP基础操作1.session操作 手动设置session生存期方式一: session_start(); // 设置生存时间 $lifeTime = 24*6000; setcookie(sess ...

  7. lwip TCP client & FreeRTOS 打开TCP 的 保活机制 LWIP_TCP_KEEPALIVE==1

    参考大神教程:http://blog.sina.com.cn/s/blog_62a85b950101aw8x.html   老衲五木 :http://blog.sina.com.cn/s/blog_6 ...

  8. Pessimistic and Optimistic locking

    事务隔离通常通过锁定任何对事务中资源的访问来实现的.总的来说,有两种方法针对事务的锁定:乐观锁(Pessimistic locking)和悲观锁(Optimistic locking) 悲观锁(Pes ...

  9. 循环 while

    day 2 ---------------------------------------------------把一件简单的事情做到极致,你就成功了. Day2作业及默写 1.判断下列逻辑语句的Tr ...

  10. ubuntu 添加开机启动服务

    新建umpserver.service [Unit] Description=UMPServer After=syslog.target network.target remote-fs.target ...