Mega Search
23.2 Million


Sign Up

Make a donation  
TDBXError on TFDStoredProc [Edit]  
News Group: embarcadero.public.delphi.database.multi-tier

I had a multi tier project in which i would collect data from a microsoft sql 2005 through a FDStoredProc with a function and the function would return a dataset to the client. When the server assigns the dataset to the result of the function and the function tries to send it to the client i get this error. Project etctec.exe raised exception class TDBXError with message 'TDBXTypes.BLOB value type cannot be accessed as TDBXTypes.Bytes value type'.

In another project i used the StoredProc of a different database with TFDStoredProc in exactly the same way and it works fine. Any ideas what would raise this error?

This is what i do in the server.

function TServerMethods1.getCategories(): TDataSet;
begin
FDStoredProc1.ParamByName('@val1').AsInteger:= 1;
FDStoredProc1.ParamByName('@val2').AsInteger:= 0;
FDStoredProc1.ParamByName('@val3').AsInteger:= 1;
FDStoredProc1.ParamByName('@val4').AsInteger:= 1;
FDStoredProc1.Open();
result:= FDStoredProc1;
end;

and the client calls it like this...

dataset:=ClientModule1.ServerMethods1Client.getCategories();

Problem comes from a field that is of type NVARCHAR(max), anyone knows a workaround to this error without changing the field type?

Edited by: Asder Qiop on Feb 5, 2014 7:58 AM

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 5-Feb-2014, at 11:59 AM EST
From: Asder Qiop