I have some web services that post datas to tables.
I have to catch table post errors in the same function not using the onPostError event.
I will use something like this :
Code: Select all
// Go into edit mode
MyDataset.Edit;
try
// Set the field(s)
// .. you can add all the fields here ...
MyDatset['Somefield'] := SomeValue;
// attempt to post the data
MyDataset.Post;
except
// something has gone wrong, cancel the edit
MyDataset.Cancel;
end;
Thanks