Advertisement

05.15.2008 at 10:25AM PDT, ID: 23405979
[x]
Attachment Details

ADO, MS SQL, Delphi 2007 - Haunting Error

Asked by developmentguru in Delphi Database, MS SQL Server, Delphi Programming

Tags: Delphi, MS SQL, 'Row cannot be located for updating. Some values may have been changed since it was last read'

I am gettiing the following error:
  'Row cannot be located for updating. Some values may have been changed since it was last read'
while using code that has worked for me in the past.  

1) I query an MS SQL 2000 database with a simple:
    select * from MyTable where ParentRef = 30
    type of query.
2) I open the query
3) I use the following code after opening the query
    DestQuery.Properties['Update Criteria'].Value := adCriteriaKey;
4) DestQuery.Edit;
5) Change the value of one field (not ID field)
    FieldByName('BackgroundColor').AsInteger := 0;
6) DestQuery.Post;
    This is the line that generates the error

As far as I know I need to
    1) make sure that the table has a Primary Key (ID bigint Identity with a primary key constraint) and
    2) set the update criteria to adCriteriaKey

Both of these have been done and still no joy.  Other reading I did suggests that the error may be linked to SQL Server 2000 SP1.  I ran the query
   select @@VESRION
and it informed me I was on SP1.  I tried to upgrade only to find out that I am already on SP4.

  The big reason I am doing this type of update is that one of the fields contains a PDF.  This is the only way I know of stuffing a PDF into the field.  If it were not for this requirement I woudl simply issue an update query.

  The code is meant to synchronize a remote database to the home database.  In this area of code I am opening a source database and a dest database, selecting the associated records in each, locating the correct row, and filling in the fields.

This is terribly urgent so I will award max points.Start Free Trial
[+][-]05.15.2008 at 10:48AM PDT, ID: 21576360

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.15.2008 at 11:02AM PDT, ID: 21576480

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.15.2008 at 11:26AM PDT, ID: 21576682

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.15.2008 at 01:31PM PDT, ID: 21577706

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.15.2008 at 02:03PM PDT, ID: 21577959

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.15.2008 at 02:05PM PDT, ID: 21577968

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 09:21AM PDT, ID: 21584117

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 09:27AM PDT, ID: 21584169

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 10:26AM PDT, ID: 21584682

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Delphi Database, MS SQL Server, Delphi Programming
Tags: Delphi, MS SQL, 'Row cannot be located for updating. Some values may have been changed since it was last read'
Sign Up Now!
Solution Provided By: developmentguru
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628