Delphi DX Seattle FMX – Datasnap Sample – ExecProc – [Value] overflow error

  

I’m running Delphi DX Seattle
and I was having a look at the data-snap sample

SamplesObject PascalDataSnapFireDACSampleDataSnapFireDAC_ProjectGroup.groupproj

I’m not worried about actually reversing a string, just wondering why the data snap call was getting the error below

These are the steps i can reproduce the error with
Step 1: Start the Server
Step 2: Start the Client
Step 3: Click the reverse string button and type “Test”. works fine
Step 4: Click the reverse button again and type “testtest”. it fails with this error

Error
[FireDAC][Stan]-704. Variable length data parameter [Value] overflow. Value length – [8], parameter data maximum length – [4].

I can change step 3 and 4 e.g.
Step 1: Start the Server
Step 2: Start the Client
Step 3: Click the reverse string button and type “123456789”. works
Step 4: Click the reverse button again and type “123”.works
Step 5: Click the reverse button again and type “123456789abcd”.fails

It seems to break after the first call, if the string is larger than the first call.
This is the code that the sample was executing

procedure TClientForm.Button1Click(Sender: TObject);
var
AString: string;
begin
AString := InputBox(‘Reverse String’, ‘Enter a String’, ”);
if AString <> ” then
begin
FDStoredProcReverse.Params[0].Value := AString;
FDStoredProcReverse.ExecProc;
ShowMessage(FDStoredProcReverse.Params[1].AsWideString);
end;
end;

Is there a better way to do this?
does anyone else get this error?

Comments are closed.