Subject Re[2]: [IBO] A Correct way for browse and detail queries with IBO
Author Mark Pickersgill
Hi Helen,

HB> Correct. Any fields from the dataset that you don't want displayed in the
HB> ib_grid, just set their Visible field attribute to False. You can also set
HB> other Grid things for the column, such as the caption, width, alignment and
HB> so on.

ah, but that will cause ALL of the data to be fetched from the
database uppon moving from one record to another.

The concept I'm after is to minimize this fetching of records, so that
whilst browsing a grid, only 3-4 fields are displayed, then when the
user presses, say "Edit", they get a second screen (or whatever) that
contains all of the fields (not just the 3-4).

I'll create an app tonight and see if the Master-Detail will suite.
I'll also have a dig around the contributed code for something
similar.

thanks again.

Mark

Thursday, November 13, 2003, 12:54:06 PM, you wrote:

HB> At 12:37 PM 13/11/2003 +1000, you wrote:
>>Hi Helen,
>>
>>thanks for direction and suggestions.
>>
>>HB> Well, first, for a selector list you wouldn't do a SELECT * query
>>HB> normally. As a diehard pedant, I won't ever use select * except if maybe
>>HB> I'm chucking a quick test app together.
>>
>>The selector query was the:
>> >> SELECT BuyerCode, BuyerName
>> >> FROM Buyers
>>
>>but yes, I agree.
>>
>>HB> Master-detail is ideal for this kind of 1:1 relationship if it's a big
>>HB> table. If the BUYERS table is only small, say less than 200 rows all up,
>>HB> you can use the same dataset for both the selector and the detail. Use a
>>HB> single datasource and link both the selector grid and the detail controls
>>HB> to it.
>>
>>hmmm, but if you wanted say 4 fields displayed in the selector list
>>but 20 fields displayed in the detail record view, then don't you have
>>to use two datasets as the displayed fields are dependant on the
>>dataset and not the grid?

HB> No. The fields are in the dataset and linked to the controls through the
HB> datasource. You can display a single field in as many controls as you wish.

>>As you pointed out:
>>
>>HB> In native IBO, the datasets drive the controls, so you set up all of the
>>HB> grid properties in the dataset and the native grid has no Columns[]
>>object.

HB> Correct. Any fields from the dataset that you don't want displayed in the
HB> ib_grid, just set their Visible field attribute to False. You can also set
HB> other Grid things for the column, such as the caption, width, alignment and
HB> so on.

HB> ColumnAttributes settings do affect behaviour in all controls.

HB> Helen




HB> ___________________________________________________________________________
HB> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
HB> without the need for BDE, ODBC or any other layer.
HB> ___________________________________________________________________________
HB> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
HB> keyword-searchable FAQ, community code contributions and more !

HB> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/