Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
...
while True;
try
Post;
Break;
except
on E:EDBEngineError do
begin
if IsKeyViolation(E) then
DataSet.FieldByName('DATE_POSTED').AsDateTime := Now
else
raise;
end;
end;
function IsKeyViolation(E : Exception) : Boolean;
begin
if (E is EDBEngineError) and (EDBEngineError(E).ErrorCount > 0) and
(EDBEngineError(E).Errors[0].ErrorCode = DBIERR_KEYVIOL) then
begin
Result := True;
end
else
Result := False;
end;