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. 003_webpack 配合babel 将es6转成es5

    今天接触了webpack,第一次使用webpack进行转码,竟然稀里糊涂就成功了,哈哈. 下面附上流程 创建个文件夹,初始化一下,首先全局安装webpack npm install webpack - ...

  2. AI R-CNN目标检测算法

    Region-CNN,简称R-CNN,是首次将深度学习应用于目标检测的算法. bounding box IOU 非极大值抑制 selective search 参考链接: https://blog.c ...

  3. 环境部署(九):linux下安装python+chrome+Xvfb

    在基于selenium进行的UI自动化测试中,开发调试环境一般都是windows操作系统.完成后需要部署到专门的测试环境. 如要要部署到linux环境的服务器(阿里云.腾讯云)执行,那么测试脚本也需要 ...

  4. Angularjs 过滤器使用

    Filter:格式化数据 // HTML表达式: {{ filter_expression | filter : expression : comparator}}   // JS表达式: $filt ...

  5. java.net.UnknownHostException: lc001 未知的网络服务

    java.net.UnknownHostException: lc001 未知的网络服务 读取的是虚拟机的名称 一.查询环境变量 :echo $HOSTNAME lc001 没什么问题 二.查host ...

  6. ProxySQL+Mysql实现数据库读写分离实战

    ProxySQL介绍 ProxySQL是一个高性能的MySQL中间件,拥有强大的规则引擎.具有以下特性:http://www.proxysql.com/ 1.连接池,而且是multiplexing 2 ...

  7. Python—元类

    什么是元类? 元类是类的类,是类的模板 元类是用来控制如何创建类的,正如类是创建对象的模板一样,而元类的主要目的是为了控制类的创建行为 元类的实例化的结果为我们用class定义的类,正如类的实例为对象 ...

  8. c++入门之输出文件流ofstream

    # include "iostream" # include"fstream" int main() { using namespace std; ]; int ...

  9. Day2 Python基础之基本操作(一)

    1.常用命令 调用cmd窗口 Win+R cmd命令窗口清屏 cls cmd命令窗口在运行python时清屏 import os i=os.system('cls') cmd命令窗口在运行python ...

  10. Django之用户上传文件的参数配置

    Django之用户上传文件的参数配置 models.py文件 class Xxoo(models.Model): title = models.CharField(max_length=128) # ...