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