After much debugging, I found the reason why. It's an absolete codeline which always removes trailing spaces. Removing the codeline fixes the behaviour.
Code: Select all
function TZAdoResultSet.GetString(ColumnIndex: Integer): string;
var
NL: Integer;
begin
Result := '';
LastWasNull := IsNull(ColumnIndex);
if LastWasNull then Exit;
Result := FAdoRecordSet.Fields.Item[ColumnIndex - 1].Value;
NL := Length(Result);
while (NL > 0) and (Result[NL] = ' ') do Dec(NL); // <<< PLEASE REMOVE THIS LINE
SetLength(Result, NL);
end;