Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Dec 2000
    Posts
    119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mystery error (A2K)

    I'm plugging away here and got the following:

    ErrNbr = -2147217887
    ErrDesc = Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

    I can't find anything in MSDN or KB or Help using the number or even the first two words of the description. I know that it is failing on an ADO Seek statement, but it looks like the code is the same as I have used before.

    Two questions:

    1) What are???

    2) What is your strategy for finding an answer to error messages like this when searches in the usual places returns nothing?

    TIA
    Donald

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Mystery error (A2K)

    ADO errors aren't the same as the errors generated by Jet or by the system. With ADO, a single problem can generate multiple errors, and you have to loop through the errors collection of the connection object to view them. You can't use the Err object because it handles Jet/System errors and won't give you the details of ADO errors. In fact, some ADO errors don't raise an Access error, so they have to be trapped separately.
    Here's how I typically handle that problem:

    <pre>Public Function Whatever()
    Dim errCurr As ADODB.Error
    Dim cnn As ADODB.Connection
    On Error Resume Proc_err

    Set cnn = CurrentProject.Connection
    '<<do something with it>>

    Proc_exit:
    On Error Resume Next
    Set cnn = Nothing
    Exit Function
    Proc_err:
    If cnn.Errors.Count > 0 Then
    For Each errCurr In cnn.Errors
    MsgBox errCurr.Number & "--" & errCurr.Description
    Next errCurr
    cnn.Errors.Clear
    Else
    MsgBox Err.Number & "--" & Err.Description
    End If
    Resume Proc_exit
    End Function</pre>

    Charlotte

Posting Permissions

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