функции сохранения, возвращающей результат:
Код: Выделить всё
function WriteDatum(out ErrorMessage: string; out SQLCode,
IBErrorCode: Longint): Boolean;
begin
Result:=False;
ErrorMessage:=''; // Сообщение об ошибке
SQLCode:=0; // Коды ошибки
IBErrorCode:=0;
try
TW.StartTransaction;
try
Q1.ExecQuery;
TW.Commit;
Result:=True;
except
TW.Rollback;
raise;
end;
except
on E:EIBError do begin
ErrorMessage:=E.Message;
SQLCode:=E.SQLCode;
IBErrorCode:=E.IBErrorCode;
end;
on E:Exception do begin
ErrorMessage:=E.Message;
end;
end;
end;