mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-16 11:42:12 +08:00
Catch date/time conversion errors in GetDateTimeValue, which happen e.g. when passing an empty date.
This commit is contained in:
@ -3597,6 +3597,7 @@ begin
|
|||||||
// Return date/time string value as expected by server
|
// Return date/time string value as expected by server
|
||||||
case Parameters.NetTypeGroup of
|
case Parameters.NetTypeGroup of
|
||||||
ngMSSQL: begin
|
ngMSSQL: begin
|
||||||
|
try
|
||||||
dt := StrToDateTime(Input);
|
dt := StrToDateTime(Input);
|
||||||
case Datatype of
|
case Datatype of
|
||||||
dtDate:
|
dtDate:
|
||||||
@ -3608,6 +3609,10 @@ begin
|
|||||||
dtDatetime:
|
dtDatetime:
|
||||||
Result := SysUtils.FormatDateTime('dd"/"mm"/"yyyy hh":"nn":"ss', dt);
|
Result := SysUtils.FormatDateTime('dd"/"mm"/"yyyy hh":"nn":"ss', dt);
|
||||||
end;
|
end;
|
||||||
|
except
|
||||||
|
on E:EConvertError do
|
||||||
|
Result := Input;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
Result := Input;
|
Result := Input;
|
||||||
|
Reference in New Issue
Block a user