try
...
except
on e:exception do
begin
//出错回滚
dm.OraSession.Rollback;
MessageBox(Handle,pchar(e.message),'保存出错',MB_OK + MB_ICONSTOP);
//恢复事务自动提交
dm.OraSession.AutoCommit := true;
OraQuery1.AutoCommit := true;
StringGrid1.SetFocus();
StringGrid1.Row := 1;
StringGrid1.Col := 3;
exit;
end;
end;