谢谢了

解决方案 »

  1.   

    DataChange事件在记录移动时也会触发UpdateData是在提交数据之前触发的
      

  2.   

    DataSource1DataChange是处理datasource1的OndataChange事件的procedure
    DataSource1UpdateData是处理datasource1的OnUpdateData事件的procedure。
    具体区别,borland的原资料,我就不翻译了:
    Write an OnUpdateData event handler to take specific actions prior to posting data changes to the database. If an application posts changes to the database and an OnUpdateData event handler exists, the handler is called before the dataset抯 Post method is executed. An OnUpdateData event handler might be useful for performing additional data processing or validation before posting
    Write an OnDataChange event handler to take specific actions when a field in the current record has been edited and the application moves to another field, or when the current record in the associated dataset changes. OnDataChange is especially useful in applications that must synchronize data display in controls that are not data-aware. This event is typically used to make sure the control reflects the current field values in the dataset, because it is triggered by all changes. Methods that can trigger this event include the Next or Prior methods for the dataset. Data-aware controls notify a data source of a data change when:Scrolling to a new record.
    Modifications to a field抯 data.The Field parameter is nil if the change can affect more than one field value (for example when moving to a new record or refreshing a record buffer).  If only one field is affected, Field indicates the edited field.
      

  3.   

    DataChange代表你这个数据在改动,但是并不代表你现在就要提交。UpdateData是你要告诉数据库,我想让这个改动的数据归入库里,也就是提交完成。
      

  4.   

    DataChange在下列两种情况下触发:
    1、记录滚动(即使数据并没有并修改)
    2、某个字段的数据被修改当数据被修改后开始提交但还没有更新到数据库前,触发UpdateData。通常是TDataSet.Post会激发它。—————————————————————————————————
    宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
    —————————————————————————————————
      

  5.   

    要授人以道。告诉你一个非常非常简单但很好的方法:当你不知哪个事件在什么时间发生时,可是在那个事件的事件过程中加一个显示,比如加个showmessage('Event!!!'),这样就很容易知道了,而且多个事件还能知道顺序。