|Subject||RE: [IBO] Statement must have an IB_Connection assigned|
> I have seen some other similar questions but have not been able toif you say this worked prior to upgrade (i.e. it worked even though you were
> resolve this issue:
> Everything worked fine till I upgraded to IBO 4.7. The DB is (FB2.0).
> now I get this error and cant seem to track it down:
> "Statement must have an IB_Connection assigned: <no name
> I have create a class for some Temporay Queries..
> classes,IBODataset, DB, csintf;
> TPKIBQuery = class(TIBOQuery)"
> then create an SQL state as follows:
> lQryMisc := TPKIBQuery.Create(nil);
> lQryMisc.SQL.Add('Select a.* from AGENCY_USER a ');
> lQryMisc.SQL.Add('Where a.LOGIN_NAME =:LOGIN_NAME');
> lQryMisc.Params.ParamValues['LOGIN_NAME'] := aUser;
> Each time I get the prepare statment i get the following error:
> "Statement must have an IB_Connection assigned: <no name>"
not assigning an IB_Connection explicitly). Then I would assume it has
something to do with creation order. If the IB_Session and IB_Connection
were created before your query, then it may have previously adopted the
default (previously created) IB_Connection.
FWIW, I would always assign an IB_Connection to the query (and perhaps a
transaction) explicitly and not rely on default assignments.