ADOTable erro message: The specified row could not be located for updating; Some values may have been changed since it was last read.

Hi there,

I'm working with ADO tables, and when I update the row, I get a message:

The specified row could not be located for updating; Some values may have been changed since it was last read.

I readed some "help" for the same problem at Visual Basic and how to solve it with Resync method, but the same method I can't call on Delphi.

Thanks
isakaAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
garybalsamoConnect With a Mentor Commented:
I receive this same error, but for different reasons.

I found that I would get this message more if I used Access 97 files instead of Access 2000.

- NEXT -

If you table does not have a Primary Index, adding one has also stopped this error message for me.
0
 
mullet_attackCommented:
Problem occurs because you are using an autoinc field in your table and the ADO datset does not re-read the record after it is written. So when you try to edit the record later, the dataset doesn't know the value for that field, assumes it to be zero, and bang -> error !

Try This:

procedure TForm1.ADOTable1AfterPost
DataSet: TDataSet);
begin
  TCustomAdoDataSet(dataset).requery;
end;

This will stop your error, however the downside is that the current record is reset to the first record. Solve that by using bookmarks etc and logic that is particular to your app.
0
 
isakaAuthor Commented:
Adjusted points from 100 to 150
0
 
isakaAuthor Commented:
If I use the bookmark than I have very ofen message that the bookmark is invalid.
Any suggestions?
0
 
djadjaCommented:
I take it another user hasn't updated the record?

Do you move off the record in any way from any other event?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.