Subject Re: [IBO] TIBOQUERY Problem
Author Artur Anjos
(I'm not posting Jason's comments again, talking about IBO & Developers Express Grid)

In some situations we need to do a fetch all do get some more funcionality from the dxGrid (sum's and so on). I'm working on a way to let the user build the query (with a Query-Assistant / DataDictionary, bla bla bla, and finnaly let the user work with all options in the grid - choosing Sums, Avrs and so on). This is a great tool, expecially when the user like to work in grids instead of reports. Also, for data export to Excel, for example, this is a much better way to do it instead of using a Report.

I had a problem here: finding if the user choose a primary key on his query, and use it on the 'KeyFields' propriety of the Grid. My users don't have the necessary tech to understand what is a 'primary key', they just choose fields and press 'the Go Button'. So I use a 'ugly' way to let the user choose a primary key. It's working, and they are using it, but I like to get back to it and put it the way I like it.

I know that IBO will use a primary key if it exists when we set 'KeyLinksAutoDefine' to true. What I don't know is the way to look in my fields to a primary key. Can someone give a 'starting point' to this? I want to be abble to see if there is a primary key or not.

This is the idea: user choose the query - I will prepare the query and look if IBO detects a primary key - warning to the user if not (something like 'you will not be abble to use the full grid options until you select a Field that is a Primary Key, such as 'ID'')- use the primary key if there is.

What I was expecting is when IBO detects a primary key to use on the TIBOQuery, that IBO put's the name of that Key in the KeyFields strings. But that propierty is always set with this value: 'DB_KEY', even when IBO does not create a field with that name.

I have talk once with Jason about this, but I had to stop because of a 'time fault exception'...

Artur Anjos

[Non-text portions of this message have been removed]