Page 1 of 1

Param loaded from stream raises an EVariantBadIndexError

Posted: Tue 15 Oct 2013 16:39
by a.alekizoglou
I have a problem with latest UniDAC.

I load a parameter from a stream file with

Code: Select all

fMemStream.Position := 0;
MyQuery.Params[i].LoadFromStream(fMemStream, ftBlob);
fMemStream.Clear;
When I run MyQuery.Execute I get an EVariantBadIndexError. The problem is in the procedure TCustomDASQL.AssignParamValue(ParamDesc: TParamDesc; Param: TDAParam).

In fact the Param.GetNativeParamObject does not get propagated immediately when the parameter is some KB. If i put a breakpoint and wait for the hint to come on the IDE for the Param.GetNativeParamObject, then the whole execution works.

Does this have to do with LoadFromStream(fMemStream, ftBlob)?

Re: Param loaded from stream raises an EVariantBadIndexError

Posted: Wed 16 Oct 2013 08:33
by AlexP
Hello,

Please specify the name of the DB you are using, also send a small sample reproducing the problem to alexp*devart*com (including the script for creating the table)

Re: Param loaded from stream raises an EVariantBadIndexError

Posted: Fri 18 Oct 2013 10:37
by a.alekizoglou
AlexP thanks,

I found the problem is related to Delphi XE3. I have to check the blob for blank and set it to null like

Code: Select all

          if fMemStream.Size = 0 then
            Params[i].Value := null
          else
            Params[i].LoadFromStream(fMemStream, ftBlob);

Re: Param loaded from stream raises an EVariantBadIndexError

Posted: Mon 21 Oct 2013 07:12
by AlexP
Hello,

Glad to see that you solved the problem. If you have any other questions, feel free to contact us