catching post errors not using events
Posted: Tue 05 Feb 2013 10:52
Hi,
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 :
How can I get the error message with a try except ?
Thanks
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