I maintain some legacy code where intensive use of TDataset.CheckBrowseMode is made instead of Post.

Could you please tell me the advantages of this?

有帮助吗?

解决方案

The fundamental difference between .Post and .CheckBrowseMode is the control of state/changes in a DataSet.
If you try to post the data in a DataSet which is not in dsEditModes an Exception will be raised.

Answering your question the advantage is:

In cases when the State is not in dsEditModes, if you call .Post you will get an Exception.

Also, when no record is modified and one calls .CheckBrowseMode, TDataSet will call .Cancel and thus, it will trigger all it's respective events.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top