Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread EDBStoredProc 'Argument out of range'
Wed, Dec 11 2013 12:02 AMPermanent Link

Peter

Delphi XE3 EDB 2.14 build 5

Hello

If I plonk an EDBStoredProc on a form, assign the name of the SP in the IDE, then call the following to open the SP, I get an 'Argument out of range' error.

   ESPDriver.Close;
   ESPDriver.Params[0].AsBoolean := False;
//    ESPDriver.ParamByName('OnlyActive').AsBoolean := False;
   try
    ESPDriver.ExecProc;
   except
    raise;
   end;

The error happens almost always the first time I call the EDBStoredProc. If I then rem the Params line and pass the ParamByName, it works. If I then rem out the ParamByName line and revert to Params - it works equally well!!

It appears that the Params list has zero members, though I am not sure that I can do anything about that.

To be fair, I sometimes copy the component from another form, as some of the fields are already populated, but I always re-assign the target SP before I do anything.

As with any mysterious error I am concerned that it will return to haunt me later. Any suggestions?

Regards

Peter
Wed, Dec 11 2013 5:37 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Peter


Add  ESPDriver.Prepare before the first time you try to use the proc.

Roy Lambert [Team Elevate]
Wed, Dec 11 2013 4:01 PMPermanent Link

Peter

Doh!

I had inspected the Params property in the IDE and noticed that in every case the correct name and index of each parameter was listed, so assumed that if it could see it in the IDE then it would see it in the app. Silly me.

Thanks Roy

Regards

Peter
Thu, Dec 12 2013 2:36 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Peter


Its caught me many times.

Roy Lambert [Team Elevate]
Image