Re: Row cannot be located for updating
From: Val Mazur (group51a_at_hotmail.com)
Date: 04/24/04
- Next message: Val Mazur: "Re: DataSet XmlWrite error (c#) - URI formats not supported"
- Previous message: Val Mazur: "Re: Source size and how to change"
- In reply to: Veerle: "Row cannot be located for updating"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 23 Apr 2004 22:41:37 -0400
Hi,
Could be your case
http://support.microsoft.com/default.aspx?scid=kb;en-us;193515&Product=ado
-- Val Mazur Microsoft MVP "Veerle" <veerleverbr@hotmail.com> wrote in message news:16c55915.0404230548.676f4052@posting.google.com... > Hi, > > I'm using ADO disconnected recordsets in my VB6 program. I use OLEDb > to connect to a SQL Server 2000 DB. > > There I have a table Test with a primary key ID and no other indexes. > I connect to de database, do "select * from Test where ID = 1" with as > result a recordset containing one row, and disconnect the recordset. > Then I change some field (other than ID), reconnect to the DB and > execute an update. This gives me the error: "Row cannot be located for > updating. Some values may have been changed since it was last read". > Strangly enough, the value that I changed, is changed in the database > as well... > > Any ideas what I'm doing wrong? Here's my code for the select: > > 'Open connection to the database > Dim Con As New ADODB.Connection > Con.Open ConnectionString > Con.CursorLocation = adUseClient > > 'Execute the query and remove the active connection > Dim Rs As New ADODB.Recordset > Rs.CursorLocation = adUseClient > Rs.Open Query, Con, adOpenForwardOnly, adLockBatchOptimistic > Set Rs.ActiveConnection = Nothing > > 'Close connection to the database > Con.Close > Set Con = Nothing > > And the code for the update: > > 'Open connection to the database > Dim Con As New ADODB.Connection > Con.Open ConnectionString > Con.CursorLocation = adUseClient > > 'Reconnect to the database and perform the update > Rs.ActiveConnection = Con > Rs.UpdateBatch > > Rs.Close > Con.Close > Set Rs = Nothing > Set Con = Nothing
- Next message: Val Mazur: "Re: DataSet XmlWrite error (c#) - URI formats not supported"
- Previous message: Val Mazur: "Re: Source size and how to change"
- In reply to: Veerle: "Row cannot be located for updating"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading