Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Row cannot be located for updating

Status
Not open for further replies.

cnealy

Programmer
Feb 25, 2002
32
0
0
US
I'm using VB 6 SP5 with an Access 97 database. Here's the scenario:

I call AddNew on a recordset, change some fields in the recordset and then call Update. The recordset is still on the same row and then I change one of the fields, and then call Update again. When I do this, I get:

Run-time error -2147217864, row cannot be located for updating

It appears that this error only happens after I have called update after calling AddNew. If I call Update on an existing record, the error does not occur.

I tried calling Requery after AddNew and Update, but this moved the position to the first row in the recordset.
 
Herman - I read the article. This is exactly the problem that I'm having. Unfortunately, I can't upgrade to Access 2000, and I must use an auto number field.

:eek:(

Surely, there's got to be a way to resolve this. I hope that I don't have to code the auto number by hand. But, at this point, that's the only thing I can think of.

 
Found a workaround on another tech site:

If Adodc1.Recordset.EditMode <> adEditAdd Then
Adodc1.Recordset.Update 'update case record
Else
Adodc1.Recordset.Update
Adodc1.Recordset.Requery
Adodc1.Recordset.MoveLast
End If

Worked like a charm. :eek:)
 
UPDATE GOES ALONG WITH EDIT. SO YOU MUST HAVE MADE THE RECORD IN THE EDIT MODE BEFORE THE UPDATE IS ISSUES
 
Thanks, Ray, but I believe that this article applies to Oracle. I'm using MS Access.

But, the good news is that the workaround that I mentioned in an earlier post appears to be working out for me.
 
Hi all

I got error number: 2147217864 on updating a recordset of ADO connected to Sql Server.
I work with VB6.0 with Sp5 and MDAC_Type2.6.
Please guide me to solve the problem.
thanx.

Reza.
 
Herman posted a link to an article that describes the problem in detail. See the second post above.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top