Subject Re: [IBO] TDataSet problem
Author Artur Anjos
Marv cook wrote:
> Hi all,
>
> I am getting unexpected results with IBO.
>
> Below is a query and two procedures that look identical to me, but
> Procedure 1 works correctly and Procedure 2 fails. In Procedure 2 the
> open statement never finds any records and is always in the insert mode.
> The only difference between them is the use of ParameterByName and
> Params[i].
>
> What am I doing wrong?
>

Marv,

When you call ParamByName, IBO will check if it's prepared or not, and
it will Prepare it for you. Otherwise you should prepare first:

(...)
EmpDefScheduleQ.Close;
EmpDefScheduleQ.Prepare;
EmpDefScheduleQ.Params[0].AsInteger := empID;
EmpDefScheduleQ.Params[1].AsInteger := DayNumber;
(...)

Artur