Subject Re: [IBO] KeyLinks AutoDefine
Author Artur Anjos
Sorry, Jason, I mean to say 'DB_KEY'. It's the field that IBO creates when it can not find a Primary Key to use as KeyField.

In the example I told you, after Open the Query, I get the value 'DB_KEY' in the KeyFields array, even if IBO don't create one.

It's very easy to recreate:

1) Create a TIBOQuery and select just the Primary Key on any Table;
2) Set KeyLinksAutoDefine to true
3) Open the Query
3) Read KeyFields[0]: the value is always Name_Of_Table.RDB$DB_KEY

So, two things:

1st) The value should be the name of the Field that IBO is using? In the example above, if I put other field on the query that it's not unique, IBO creates the field with the name "DB_KEY'.

2nd) What's the propriety in TIBOQuery to find out if the field is a primary key? That will be enough for me: I will check if IBO created a DB_KEY field: if so, I will use this field for my purposes, if not I will choose the primary key field.

Sorry about my english!

Artur Anjos

----- Original Message -----
From: Jason Wharton
Sent: Wednesday, October 31, 2001 12:19 AM
Subject: Re: [IBO] KeyLinks AutoDefine

What do you mean by ID_KEY. There isn't such a thing in your table.
It should pick up your primary key column.
If it isn't send me a sample privately.

Jason Wharton
CPS - Mesa AZ

----- Original Message -----
From: "Artur Anjos" <arsoft@...>
To: <>
Sent: Tuesday, October 30, 2001 4:12 PM
Subject: Re: [IBO] KeyLinks AutoDefine

> Jason, I have use it with no luck.
> When I use KeyFields AutoDefined, and do a simple select in a table
choosing the table Primary Key, I thougth that IBO will detect a Primary Key
and use it, instead of cretating the field ID_KEY. Am I rigth?
> Example:
> Table (
> A_ID PrimaryKey
> A_XX OtherField
> )
> If the Query is SELECT A_ID,A_XX FROM TABLE what will IBO do when
KeyLinksAutoDefined=True? Generate a Field ID_KEY or use A_ID as primary
> In this small example I have ID_KEY in the KeyFields array, after Prepare.
> Artur

Yahoo! Groups Sponsor

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

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

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