Delphi FireDac和中止前post,以及system.abort
在continue to中,当使用FireDac并调用BeforePost事件到调用Abort的函数时,会导致整个系统中止,从而中断围绕该中止运行的循环Delphi FireDac和中止前post,以及system.abort,delphi,exception,firedac,Delphi,Exception,Firedac,在continue to中,当使用FireDac并调用BeforePost事件到调用Abort的函数时,会导致整个系统中止,从而中断围绕该中止运行的循环 while not fdOtherQuery.eof do begin fdQuery.insert; fdquery.fields[0].asstring := fdOtherQuery.fields[0].asstring; fdquery.post; fdOtherQuery.next; end; 邮寄前: procedur
while not fdOtherQuery.eof do begin
fdQuery.insert;
fdquery.fields[0].asstring := fdOtherQuery.fields[0].asstring;
fdquery.post;
fdOtherQuery.next;
end;
邮寄前:
procedure TForm1.AzureDayarKriaAdditionsBeforePost(DataSet: TDataSet);
begin
calculcation;
end;
procedure calculaction;
begin
if fdQuery.fields[0].asstring = 0 then abort;
end;
如果调用计算中的中止,则
而不是fdOtherQuery.eof do begin
也被停止中止会引发一个静默异常,可以通过try。。。除了
while not fdOtherQuery.eof do begin
fdQuery.insert;
fdquery.fields[0].asstring := fdOtherQuery.fields[0].asstring;
try
fdquery.post;
except
on E: EAbort do
begin
// log the error (when needed)
end;
end;
fdOtherQuery.next;
end;