koma
Jul 31st, 2000, 01:39 AM
I get the following error message when trying to use the update method on an ADO recordset:
Run time error '-2147467259 (80004005)':
Query-based update failed because the row to update could not be found.
Does anyone have a clue?
koma
Jul 31st, 2000, 03:14 AM
This is strange:
The error does only occur every other time I run my project.
Here is the code that is run:
mConnection.Execute strUpdate, lngRecordsAffected, adCmdText
If Not lngRecordsAffected = mrecCurrentSelection.RecordCount Then
Debug.Print "DatabaseLayer.ChangePricesInCurrentSelectionWithFactor(): Didn't update all records in Current Selection!"
End If
ChangePricesInCurrentSelectionWithFactor = lngRecordsAffected
mrecCurrentSelectionView.Resync
mrecCurrentSelectionView.MoveFirst
ParseRounding varRounding, lngAvrundningsregelId
Dim lngRounded As Long
While Not mrecCurrentSelectionView.EOF
If Not IsNull(mrecCurrentSelectionView.Fields(strRoundPrice).Value) Then
mrecCurrentSelectionView.Fields(strRoundPrice).Value = RoundMe(mrecCurrentSelectionView.Fields(strRoundPrice).Value, varRounding)
mrecCurrentSelectionView.Update ' <---- The error occurs here
End If
mrecCurrentSelectionView.MoveNext
If lngRounded Mod 50 = 0 Then DoEvents
lngRounded = lngRounded + 1
Wend