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['Upda
te Criteria'].Value := adCriteriaKey;
4) DestQuery.Edit;
5) Change the value of one field (not ID field)
FieldByName('BackgroundCol
or').AsInt
eger := 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