diff --git a/Source/BoldPMappersAttributeDefault.pas b/Source/BoldPMappersAttributeDefault.pas index e1100fc..dd1e992 100644 --- a/Source/BoldPMappersAttributeDefault.pas +++ b/Source/BoldPMappersAttributeDefault.pas @@ -425,6 +425,14 @@ function TBoldPMString.CompareField(const ObjectContent: IBoldObjectContents; co procedure TBoldPMString.ValueToParam(const ObjectContent: IBoldObjectContents; const Param: IBoldParameter; ColumnIndex: Integer; TranslationList: TBoldIdTranslationList); +const +{$IFDEF BOLD_UNICODE} + // check for 4000 chars, because since using unicode + // each char requires twice as much space + cnMaxMSSQLStringLength = 4000; +{$ELSE} + cnMaxMSSQLStringLength = 8000; +{$ENDIF} var aString: IBoldStringContent; begin @@ -435,7 +443,7 @@ procedure TBoldPMString.ValueToParam(const ObjectContent: IBoldObjectContents; c else begin // the setting of Param DataType is a workaround for UniDAC MSSQL param trim to 8000 bug. - if Length(aString.AsString) >= 8000 then + if Length(aString.AsString) >= cnMaxMSSQLStringLength then Param.DataType := GetColumnBDEFieldType(0); Param.AsString := aString.AsString; end;