Subject | Re: [IBO] TDataSet problem |
---|---|
Author | Artur Anjos |
Post date | 2004-05-25T17:57:42Z |
Marv cook wrote:
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
> Hi all,Marv,
>
> 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?
>
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