Pass long Unicode strings to FireDac TADQuery parameter

anydac, delphi, firedac

Solution

The TFDParam type has an .AsWideMemo in XE5 that should accept unicode characters correctly and get around the size limitation you encountered.

ADQuery.Params.ParamByName('MyFld').AsWideMemo := 'Some unicode string';

Problem

I was using AsWideString to pass Unicode string to TADQuery parameter. ``` ADQuery.Params.ParamByName('MyFld').AsWideString ``` But when string becomes too long I got error: ``` [MyFld]. Max len = [8002], actual len = [10522] ``` Then I decided to use AsMemo property ``` ADQuery.Params.ParamByName('MyFld').AsMemo ``` In this case my Unicode string is not displayed correctly. What is the way to solve both problems?

Original source

Related problems