我在向数据库表中插入数据的时候,关键字段重复的话它并不提示出错,只是不能插入到数据库的表里去(是在保存数据的时候)。我在工具的DEBUGGER OPTIONS的选项里没有选择INTEGRATED DEBUGGING该项。我想要的结果是在我保存数据的时候如果出错提示一下。
如:try
simpledataset.ApplyUpdates(0);
self.Close;
except
showmessage(‘插入有误,不能保存结果');
end;
如:try
simpledataset.ApplyUpdates(0);
self.Close;
except
showmessage(‘插入有误,不能保存结果');
end;
on e:exception do
showmessage(e.classname + e.message);
end;
捕捉错误。
我的意思是要执行EXCEPT后的语句
try
try
simpledataset.ApplyUpdates(0);
except
on E:Exception do ShowMessage(E.Message);
end;
finally
self.close;
end;