Row cannot be located for updating

From: Alverio (alverio.m_at_tiscali.it)
Date: 09/15/04


Date: Wed, 15 Sep 2004 21:08:43 +0200

I can see that this is a problem for many people.
I use Delphi 6, Access 97 database and ADO.
I have just installed Jet 4.0 SP 8, without solving my problem both with
Windows 98 and Windows 2000.
I have a master table and a detail table. Relationship is between field ID
(autoincrement field and primary key in MasterTable) and IDMaster (numeric
field in DetailTable). DetailTable has an autoincrement field as primary
key. The relationship is created in Access as well. I'm using
ADODatasets.CursorLocation is clUseClient and CursorType is ctStatic
Anytime I add a new record in DetailTable I can see that IDMaster is filled
with the proper value from MasterTable: When I post the record its primary
key is 0.
First case.
If I refresh, I get the error message "Key value for this row was changed
or deleted at the data store. The local row is now deleted" and actually the
row seems to disappear. But If a close the debugger and re-launch it the row
is there, with the proper ID value!
Second case.
If I delete or change the record I get the message "Row cannot be located
for updating. Some values may have been changed since it was last read".
Close and re-launch the debugger and the row is there, with the proper ID
value.
I've set ADODataSet.Properties['Update Criteria'].value to adCriteriaKey in
the BeforeRefresh and BeforeDelete methods of both Datasets without
result.I've tried also setting different values.
And I've also set the AutoGenerateValue property of ID in DetailTable to
arAutoInc.
Even worse! I've just discovered that even the primary key of MasterTable
doesn't generate auomatically!
I really don't understand how coming out from this nightmare. Back to BDE?

Thanks a lot.



Relevant Pages

  • Re: Row cannot be located for updating
    ... Both primary keys in MasterTable and DetailTable are Autoincrement field ... But the problem seems to be on the Primary key fields, ... > The master linking field in the detail table needs to be of type Integer ...
    (borland.public.delphi.database.ado)
  • Re: Row cannot be located for updating
    ... >(autoincrement field and primary key in MasterTable) and IDMaster (numeric ... DetailTable has an autoincrement field as primary ... The master linking field in the detail table needs to be of type Integer to link ...
    (borland.public.delphi.database.ado)
  • Re: Row cannot be located for updating
    ... >The table have a primary key based on an Autoincrement field. ... >proper value but always with 0. ... Brian Bushay (TeamB) ...
    (borland.public.delphi.database.ado)
  • Re: Search Form - Take 2
    ... While in Design mode, highlight all of the fields you want to include in the ... selected fields to the primary key. ... as its due to the fact that the columns in master allow Nulls. ... well enter the same 'keyword' slightly differently, ...
    (microsoft.public.access.gettingstarted)
  • Re: Search Form - Take 2
    ... selected fields to the primary key. ... description column in Recommendations or Accomplishments you'll have some ... as its due to the fact that the columns in master allow Nulls. ... well enter the same 'keyword' slightly differently, ...
    (microsoft.public.access.gettingstarted)