Catch date/time conversion errors in GetDateTimeValue, which happen e.g. when passing an empty date.

This commit is contained in:
Ansgar Becker
2014-07-26 14:14:38 +00:00
parent 956ea205eb
commit 07bdeea79f

View File

@ -3597,6 +3597,7 @@ begin
// Return date/time string value as expected by server
case Parameters.NetTypeGroup of
ngMSSQL: begin
try
dt := StrToDateTime(Input);
case Datatype of
dtDate:
@ -3608,6 +3609,10 @@ begin
dtDatetime:
Result := SysUtils.FormatDateTime('dd"/"mm"/"yyyy hh":"nn":"ss', dt);
end;
except
on E:EConvertError do
Result := Input;
end;
end;
else
Result := Input;