Subject Re: [IBO] IBOQuery and TDBLookupComboBox
Author Jason Wharton
Paul,

Apologies for not answering this sooner but so far I have not completely
understood the nature of your problem.
The monitor probably won't reveal much other than that the queries are
getting the right data from the server.

Which version of IBO are you on?
Would it be possible you could send me a working sample of your problem?

One thing to try, set the AutoFetchAll property to true on the lookup
datasets. How big are they?

Regards,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


----- Original Message -----
From: "paultugwell" <pault@...>
To: <IBObjects@yahoogroups.com>
Sent: Monday, April 15, 2002 4:44 AM
Subject: [IBO] IBOQuery and TDBLookupComboBox


> I have converted an application from BDE to IBO and am having a
> problem with getting the data in a TDBLookupComboBox to track the
> data in the undelying query.
>
> 3 IB tables are involved
> SalesItems (SI), Categories (C) and SubCategories (S)
>
> SI contains fields CAT and SUBCAT (and other fields) which are
> populated by selecting values linked to the tables C and S
>
> Table C contains a field CAT (and other fields) and table S contains
> fields CAT and SUBCAT (and other fields).
>
> There are 2 IBOQueries
> SELECT CAT FROM CATEGORIES
> and
> SELECT CAT, SUBCAT FROM SUBCATEGORIES WHERE CAT = :CAT
> This query is linked to the first query by a TDataSource component.
>
> Both queries are selecting the correct information.
> When moving through the a query based on SI, the values of SI.CAT and
> SI.SUBCAT change. When SI.CAT changes, the TDBLookupComboBox linked
> to the SI.CAT field updates correctly but the TDBLookupComboBox
> linked to the SI.SUBCAT does not even though the correct values are
> fetched by the query.
> Sometimes the value displayed is correct but at other times (more
> commonly) the value displayed is blank. It is even possible to scroll
> forward through a record and the value to display correctly and the
> scroll back from the following record and the value to display as a
> blank.
>
> I placed an IB_Monitor component on the offending form and obtained
> the following output when scrolling from one record to the next. It
> is clear from this that the problem has been caused by the order of
> the SQL statements. The change in SI cause a change in SI.CAT
> from 'ZINTEC O/S' to 'ALUMINISED' and a change in SI.SUBCAT from NULL
> to 'AS04'. However the subcategories table is queried to locate the
> SUBCAT before the subcategories IBOQuery is updated, resulting in the
> error. In the BDE version of this program there is no such problem!
> Can you help me?
>
>