Frage

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?

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top