Re: "Row cannot be located for updating"



What unit should I include to reference the adCriteriaKey ?
Because I got undeclared identifier.

"Brian Bushay TeamB" <BBushay@xxxxxxxxx> wrote in message
news:pshv219g8pr6amif0ismamjfiorhg9sb82@xxxxxxxxxx
> >When I use my program to create and save a record, it's working fine, but
if
> >I immediately do other modifications (using auto-edit mode), I got the
> >following error when applying the changes:
> >"Row cannot be located for updating. Some values have been changed since
it
> >was last read".
> >
> >I use Delphi 7 (build 8.1), ADO components (with the MS-Jet driver and
> >TADOTable), MSAccess 2002 (with a database using a 2000 format), and
> >WindowsXP (SP1).
> >
> >All my tables have primary keys based on the Access Autoincrement type
> >The tables have some master-detail links, but the problem occurs if the
> >change is made on a master or a detail table.
> >I post the changes from my master table first, then the details one.
> >I have no problem if I reload the record before I made the changes.
>
> The error means that the values of the fields of a record in the database
are
> not the same as the original values in your clientside record.
> The default for Borland's ADO components is to use all field values when
> locating the record to be updated.
> You can change this to just use the key fields by changing the Update
Criteria
> property.
>
> ADODataSet1.Properties['Update Criteria'].value :=adCriteriaKey;
>
> Your choices are adCriteriaKey, adCriteriaAllCols (BDE's default),
> adCriteriaUpdCols (ADO's default) and adCriteriaTimeStamp. Search the
> Platform SDK for more details.
>
> You should set this property in the BeforeUpdate and BeforeDelete events.
> http://support.microsoft.com/default.aspx?scid=kb;EN-GB;q190727&GSSNB=1
>
> Your other option would be to resync each record after it is posted
>
>
> --
> Brian Bushay (TeamB)
> Bbushay@xxxxxxxxx


.



Relevant Pages

  • Re: Many problems with ADO
    ... If I scroll the Master table, ... >But if I try to cancel or modify the record just added, ... Your choices are adCriteriaKey, adCriteriaAllCols, ... >With CursorLocation as clUseClient and CursorType as ctStatic, ...
    (borland.public.delphi.database.ado)
  • Re: "Row cannot be located for updating"
    ... >All my tables have primary keys based on the Access Autoincrement type ... >I post the changes from my master table first, ... Your choices are adCriteriaKey, adCriteriaAllCols, ... You should set this property in the BeforeUpdate and BeforeDelete events. ...
    (borland.public.delphi.database.ado)
  • Re: Unable to locate rows for updating
    ... >I have a master detail invoice form where the user selects the customer, ... ADO needs to be able to find the record in your database to delete. ... Your choices are adCriteriaKey, adCriteriaAllCols, ...
    (borland.public.delphi.database.ado)
  • Re: "Row cannot be located for updating"
    ... >>All my tables have primary keys based on the Access Autoincrement type ... >>I post the changes from my master table first, ... > Your choices are adCriteriaKey, adCriteriaAllCols, ... > You should set this property in the BeforeUpdate and BeforeDelete events. ...
    (borland.public.delphi.database.ado)
  • Re: Row cannot be changed.. message with MySQL
    ... When you link tables together you have to tell the database which table you ... MyTable.Properties.value:= adCriteriaKey; ... I have to table with master detail ... When I post a calculation value from detail table to master ...
    (borland.public.delphi.database.ado)