Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003

    Unanswered: List of Access error codes

    Is there a list anywhere of the run-time error codes one might encounter in Access?

  2. #2
    Join Date
    Jul 2003
    Do you mean all 65K+ of them? The description for a large portion of them
    is "Application or Object defined error". I don't know of a published list.
    What would you want to use it for?
    Inspiration Through Fermentation

  3. #3
    Join Date
    Jul 2003

    ... but if you really want to know

    Create a table with two fields:
    ErrNum Long
    ErrDesc Text(255)

    Paste this code in a standard module, and execute CreateErrList:
    Public Declare Function FormatMessage Lib "kernel32" Alias "FormatMessageA" (ByVal dwFlags As Long, lpSource As Long, ByVal dwMessageId As Long, ByVal dwLanguageId As Long, ByVal lpBuffer As String, ByVal nSize As Long, Arguments As Any) As Long
    Sub CreateErrList()
    DIM X as Long, strErr as string
    For X =1 to 65535
      If strErr = "Application-defined or object-defined error" Then
         strErr = MessageText(lngError)
      End If
      Docmd.RunSql "Insert Into Err_Desc (ErrNum, ErrDesc) values(" & X & ", '" & strErr & "')"
    next X
    Function MessageText(lCode As Long) As String
        Dim sRtrnCode As String, lRet As Long
        sRtrnCode = Space$(256)
        lRet = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0&, lCode, 0&, sRtrnCode, 256&, 0&)
        If lRet > 0 Then
           MessageText = Left$(sRtrnCode, lRet)
           MessageText = "Error not found."
        End If
     End Function
    The MessageText function looks for more definition for errors that are just
    "Application-defined or object-defined error"
    Sometimes it finds something, sometimes it doesn't.

    The list won't be all inclusive of errors you'll encounter, just the ones that are specific to Access. I think it depends on what apps you're using in conjuntion with Access. For example, my back end is a SQL Server database... I see error numbers like -2147467259

    Inspiration Through Fermentation

  4. #4
    Join Date
    Nov 2002

    Cool This site is a good start

    Obviously not all of them can be found here: , but it is quite a large list. Most of the errors that you will commonly encounter are found in these pages. Good luck!

Posting Permissions

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