Subject Re: [IBO] About "Record was not located to update"
Author Helen Borrie
At 10:15 PM 15/01/2003 +1100, you wrote:

>Hi All.
>I need help!!!!!!!!
>I using IBObjects components for migrating
>application from DBase to Interbase.
>Even if I try create very simple app.,
>i have this problem.
>On form I have IB_Connection,IB_Transaction,
>IBOTable,DataSource and DBGrid components.
>All components connected as required.
>Now, if I try add record to table in DBGrid by pressing
>"Down arrow" button on keyboard, next error arise.
>I input value in first field of new record, then
>go to another record, and then go back to last record.
>Now if I try input value to any field of last record and
>then go to another record,
>"Record was not located to update" exception arise.
>In Monitor output present this string:
>CEHLIST.RDB$DB_KEY = DB_KEY <n> $0000000000000000
>Thus, number of record in my table is not right.
>I don't know, why.
>Please help!!!!!!!
>Thank you very much.
>But what I would make
>IF my table haven't Primary Key???????????????

In order for your your dataset to be updatable, it must have a group of one
or more columns identifed as KeyLinks, such that each row in the dataset
can be uniquely identified in the the database. In the case of a query
derived from one table, the primary key normally performs this role, and
IBO will find it automatically if KeyLinksAutoDefine is true.

Because you have no primary key, IBO attempts to assert this uniqueness by
using the RDB$DB_KEY, a unique "row key" which Firebird/IB assigns
internally to the output set. Fb/IB tables do not have record
numbers: RDB$DB_KEY is not valid outside the transaction in which it appears.

If you want to try it, you could attempt to have IBO use RDB$DB_KEY as
KeyLinks. To do so, enter DB_KEY into the KeyLinks property. Just be sure
to understand that it is NOT a primary key and it is not permanent.
It seems as though you need to begin by understanding how a relational
database management system such as Fb/IB differs from a desktop database
such as dBase. The paper "Moving to Client/Server" on may help you to understand some of these

We won't teach you database theory in the IBO list. IBO *implements* the
capabilities and features made available by Fb/IB, but it doesn't teach you
what those capabilities and features are. The ib-support list should be
able to assist with any questions you have regarding the "basics" of
relational concepts and SQL. (