Subject [IBO] Re: IBO 4.5Ai TIBOtable problem
Author tibotaka
I'm not very experienced IBObjects user,
but for me it seems be answered by Helen Borrie in
http://groups.yahoo.com/group/IBObjects/message/33356:

...begin of citation...
I don't see any sign of TDataset's Fields.Clear ?

Don't forget that TDataset creates persistent field objects!! They
*persist* unless you do something that clears them.

With the TIBO* dataset, I believe you can take care of the whole lot
(TDataset's Fields as well as the InternalDataset.Fields, by
explicitly
calling Unprepare.

Helen
...end of citation...

But I have no idea why it was working for You in IBO4.20i...

tibotaka

--- In IBObjects@yahoogroups.com, Hans <hhoogstraat@s...> wrote:
> A friend of me has similar experiences with programs that have been
working
> for years on 4.2 and just don't want to work with 4.5A+. If
interested I
> can bring you in contact with him to possibly find some solution.
>
>
--------------------------------------------------
--------------------------------------------
> ----- Original Message -----
> From: "colincoleman2002" <yahoogroups@c...>
> To: <IBObjects@yahoogroups.com>
> Sent: Saturday, April 02, 2005 4:32 AM
> Subject: [IBO] Re: IBO 4.5Ai TIBOtable problem
>
>
> >
> >
> > And some more investigation reveals:-
> >
> > I have now built a clean Xp machine loaded Delphi7,IBO 4.20I ,And
a
> > host of other components same as my main development machine, and
> > have copied the whole project from the main machine to the new PC
> > and then compiled the project using the DOS compiler, so i dont
> > change ANYTHING in the project and guess what it all Works
> > perfectly!. (Using IBO4.20i)
> >
> > It Appears that whenever the IBOtable component gets written to it
> > seems to lock the fields into its memory somewhere and thats it,
it
> > only wants to use for these fields forever once written, as
though i
> > have created persistant fields, if this is the case how do i
rectify
> > it, ive tried adding this following code during the table open and
> > it still crashes.
> >
> > sTablename := IBOTableClient.TableName ; // Eg CUSTOMERS
> > FormMainReplicate.Memo1.lines.add(sTablename+'
> > Before='+IBOTableClient.SQL.Text +
> > ' FieldCount ='+IntToStr(IBOTableClient.FieldCount));
> > IBOTableClient.SQL.Clear;
> > IBOTableClient.FieldDefs.Clear;
> > IBOTableClient.MasterSource := DataSourceQClient;
> > IBOTableClient.TableName := sTablename ;
> > FormMainReplicate.Memo1.lines.add(sTablename+ 'After='
> > +IBOTableClient.SQL.Text+
> > ' FieldCount =' +
> > IntToStr(IBOTableClient.FieldCount));
> > Try
> > IBOTableClient.Open;
> > Except
> > FormMainReplicate.Memo1.lines.add('*** CRASHED *** '+
> > sTablename+' ='+
> > IBOTableClient.SQL.Text+' FieldCount ='+
> > IntToStr(IBOTableClient.FieldCount));
> > Exit;
> > End;
> >
> > If you could help me with this i would be very grateful as i seem
to
> > be getting nowhere except being able to pont the finger at IBO
4.5Ai
> > as the root cause.
> >
> > Thanks Jason or anyone that can help me..
> >
> > Colin
> >
> >
> >
> >
> >
> > --- In IBObjects@yahoogroups.com, "colincoleman2002"
> > <yahoogroups@c...> wrote:
> >>
> >> I have more information as to where the IBO component crashes: it
> >> appears to be in the following routine.
> >>
> >> procedure TIBODataset.InternalOpen;
> >> begin
> >> if not InternalDataset.Prepared then
> >> InternalDataset.Prepare;
> >> if FRefreshingParamsLevel = 0 then
> >> begin
> >> FIncludeOutputParams := false;
> >> if ( InternalDataset.FieldCount > 0 ) and
> >> ( FieldDefs.Count = 0 ) then
> >> InternalInitFieldDefs;
> >> if DefaultFields then
> >> CreateFields;
> >> if foAutoAppendAllFields in FFieldOptions then
> >> AppendOtherFields;
> >> BindFields( True );
> >> InitFields;
> >> FRecInfoOfs := FRecordSize + CalcFieldsSize;
> >> FRecBufSize := FRecInfoOfs + SizeOf( TIBORecInfo );
> >> end;
> >> InternalDataset.FIsCursorOpen := true;
> >> end;
> >>
> >>
> >> Stepping through in Delphi 7.0 creashes on the line BindFields(
> >> True );, even trying to use stepinto will not work as it just
> >> crashes without opening the routine.. if this is any help
> >>
> >> Thanks
> >>
> >> Colin
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> --- In IBObjects@yahoogroups.com, "colincoleman2002"
> >> <yahoogroups@c...> wrote:
> >> >
> >> > We have a larger project that essentially has a TIBOQuery as a
> >> > master and a TIBOTable as a detail table, the program uses the
> > SQL
> >> > to create a complex query that returns only the Primary key
> > field
> >> > for the table required,
> >> >
> >> > The Query And Table are configured Thus:-
> >> > With DataModule1 Do
> >> > Begin
> >> > IBOTableClient.Close;
> >> > IBOTableServer.Close;
> >> > IBOQueryClient.Close;
> >> > IBOQueryServer.Close;
> >> >
> >> > IBOQueryClient.SQL.Clear;
> >> > IBOQueryClient.SQL.Add(sClientSql);
> >> > IBOQueryServer.SQL.Clear;
> >> > IBOQueryServer.SQL.Add(sServerSql);
> >> >
> >> > IBOTableClient.TableName := sTableName ; // EG CUSTOMERS
> >> > IBOTableServer.TableName := sTableName ;
> >> > IBOTableClient.MasterFields := sPrimaryKeyname ; // EG
> > CUSTREF
> >> > IBOTableServer.MasterFields := sPrimaryKeyname ;
> >> > IBOTableClient.IndexFieldNames := sPrimaryKeyname ; // Eg
> >> CUSTREF
> >> > IBOTableServer.IndexFieldNames := sPrimaryKeyname ;
> >> >
> >> > IBOQueryClient.Open; // Always open Fine ;-)
> >> > IBOQueryServer.Open;
> >> >
> >> > IBOTableClient.OPen; // RANDOM CRASHES...Field not found
> >> > IBOTableServer.Open; // RANDOM CRASHES ...Field not found
> >> > end;
> >> > End;
> >> >
> >> > THE PROBLEM:
> >> > This has worked for years with no changes, wher there are about
> > 50
> >> > tables, and this routine is called with each SQL, tablename,
> >> > Prikey,etc... BUT since upgrading from Ver 4.0 to 4.5Ai, what
> >> > happens is that the 2 TIBOTables randomly dont change the
> >> tablename
> >> > to the next table , on investigation we can see that the
> > internal
> >> > fieldnames are still pointing to the previous table thus giving
> > us
> >> > the error, "Field custref not found", even though the
> >> > IBOTABLE.tablename says the correct table.
> >> >
> >> > its as though the setting of TIBOTable.Tablename does not
> > retrieve
> >> > the fields from the database, but retains the last field list,
> > of
> >> > course when the table is opened it crashes.
> >> >
> >> > Where do i look to fix this SERIOUS problem with 4.5Ai ?
> >> >
> >> > Cheers
> >> >
> >> > Colin Coleman