Results 1 to 2 of 2

Thread: Update error message

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 1999
    Location
    Linköping, Sweden
    Posts
    19

    Exclamation

    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?
    /Magnus

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Jul 1999
    Location
    Linköping, Sweden
    Posts
    19
    This is strange:
    The error does only occur every other time I run my project.

    Here is the code that is run:
    Code:
        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
    /Magnus

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width