Subject Re: [IBO] Weird column showing in grid
Author Marcin Bury
Dave

When you set some columns parameters in GridLinks, only these columns
will be displayed in the grid. You can only specify column name to be
displayed. You can use this property instead of setting entry in
FieldsVisible of TIB_Query, more convenient IMHO

My $0.02
Marcin

W dniu 13.08.2011 18:39, squidsrus85 pisze:
> Hi Markus,
>
> Thanks again for the quick reply. Ironically, by setting the Column Width in the TIB_Grid.GridLinks, in my other question, the DB_KEY field went away. {grin}
>
> I am forcing myself over to Firebird and the learning curve is a little jagged and steep, but with help like this I will be comfortable in no time at all.
>
> Thanks again, very much appreciated.
>
> Dave
>
>
> --- In IBObjects@yahoogroups.com, Markus Ostenried<macnoz@...> wrote:
>>
>> On Sat, Aug 13, 2011 at 03:05, squidsrus85<squidsrus85@...> wrote:
>>> Hi All,
>>>
>>> I have a TB-Grind and an SQL statement of
>>>
>>> SELECT name FROM TBL_ACCOUNTS whici does what I need, but I am also getting a column with a big number and the header of "DB_KEY"
>>>
>>> How can I hide that?
>>
>> Hi Dave,
>>
>> IBObjects does a lot of stuff in the background for you. For that it
>> needs a column with unique values. Since you didn't select a primary
>> key column IBO uses db_key instead, which is generated by Firebird and
>> unique per result set (I think). You have several options:
>>
>> 1) Just hide db_key:
>> Double click the query (to open it's design time editor), prepare the
>> query (click the light bulb icon), and then on the FieldProperties tab
>> select the db_key column and set it's Visible property to False. Have
>> a look at your IB_Query1.FieldsVisible property afterwards: you can
>> add these entries to IB_Connection.FieldsVisible, too, so they act as
>> default for all the queries using that IB_Connection.
>>
>> 2) Use NAME as key:
>> If your "name" column only contains unique values then you can tell
>> IBO to use this column instead of db_key: Open the property editor
>> (like above), select the tab SQL, there select tab KeyLinks and in the
>> KeyLinks memo field enter NAME and uncheck KeyLinksAutoDefine.
>> If your statement contains relation aliases (like "select a.name from
>> tbl_accounts a") then you need to set KeyLinks=A.NAME and
>> KeyRelation=A.
>>
>> 3) select primary key:
>> This is what I prefer: in your select statement include the primary
>> key column (like "select account_id, name from tbl_accounts"), and
>> then make your account_id column invisible like under 1).
>>
>> HTH,
>> Markus
>>
>> PS: with 2) Maybe if you leave KeyLinksAutoDefine=true then IBO will
>> fill in KeyLinks and KeyRelation correctly for you. You have to test
>> it yourself. I'm just used to specifying them myself since I always
>> use relation aliases and there was a problem with IBO detecting the
>> KeyRelation correctly.
>>
>
>
>
>
> ------------------------------------
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
> keyword-searchable FAQ, community code contributions and more ! Yahoo! Groups Links
>
>
>
>