Hi all,
The problem was the primary key on the table.
thanks
GV
"gv" <viatorg.RemoveThis@musc.edu> wrote in message
news:%23UHiqL6DFHA.3924@TK2MSFTNGP09.phx.gbl...
> Hi all,
>
> Getting the error message when updating a record.
> "Error -2147217864 Row cannot be located for Updating. Some
> values
> may have been changed since it was last read."
>
> Doesn't happen all the time, just sometimes. If I update one record and
> then
> move to a new record and try to update I get
> that error.
>
> VB6 application, and tried with the lastest ADO2.8
> SQL Server 2000
>
> I declare this on the top of the form:
>
> Public WithEvents rsEdit As ADODB.Recordset
>
> Load form event I have this:
>
> Set CmdEdit = New ADODB.Command
> CmdEdit.CommandText = "record_source"
> CmdEdit.CommandType = adCmdStoredProc
> CmdEdit.ActiveConnection = ConnAddtxt
>
> Set rsEdit = New ADODB.Recordset
> Set rsEdit.Source = CmdEdit
> rsEdit.CursorType = adOpenStatic
> rsEdit.LockType = adLockOptimistic
> rsEdit.Open
> rsEdit.MoveFirst
>
> Set txtfield(0).DataSource = rsEdit
> txtfield(0).DataField = "Col1"
> Set DateAdd.DataSource = rsEdit
> DateAdd.DataField = "Col2"
> Set txtfield(2).DataSource = rsEdit
> txtfield(2).DataField = "Col3"
> etc......................and so on
>
> rsEdit.MoveFirst
> BMark = rsEdit.Bookmark
>
> I can move through the records with buttons on the form with this:
>
> Select Case Index
>
> Case 0
> rsEdit.MoveFirst
> Case 1
> rsEdit.MovePrevious
> If rsEdit.BOF Then
> rsEdit.MoveFirst
> End If
> Case 2
> rsEdit.MoveNext
> If rsEdit.EOF Then
> rsEdit.MoveLast
> End If
> Case 3
> rsEdit.MoveLast
> End Select
>
> I have an event for the recordset like this to just show a label where I'm
> at in the recordset:
>
> Private Sub rsEdit_MoveComplete(ByVal adReason As ADODB.EventReasonEnum,
> ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal
> pRecordset As ADODB.Recordset)
>
> Label1.Caption = "Record: " & _
> CStr(rsEdit.AbsolutePosition) & _
> " of " & Str(rsEdit.RecordCount)
>
> End Sub
>
>
>
> I have a Update button on the form and this is part of what is there:
>
> Dim CurrBookmark As Variant
> CurrBookmark = rsEdit.Bookmark
> rsEdit.Update
> rsEdit.Requery
> rsEdit.Bookmark = CurrBookmark
>
>
> thanks
> Gerry
>
>
>
>
>
><!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: Error -2147217864 Row cannot be located for Updating