[AccessD] Error List

Beach Access Software bchacc at san.rr.com
Sun Oct 15 10:11:05 CDT 2006


Marty:

Thanks for the fast reply.  Worked like a charm.

Rocky


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of MartyConnelly
Sent: Sunday, October 15, 2006 7:52 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Error List

Here build your own ;)


'Determine the Error Codes Reserved by Microsoft Access and the 
Microsoft Jet Database Engine
'ErrorCode    ErrorString
'2585    This action can't be carried out while processing a form or 
report event. at A macro specified as the
'OnOpen, OnClose, OnFormat, OnRetreat, OnPage, or OnPrint property 
setting contains an invalid action
' for the property. at When you click OK, an Action Failed dialog box will 
display the name of the macro that failed and its arguments. at 1@611909 at 1

'See Also
'The following procedure creates a table containing many of the error 
codes and strings
'used or reserved by Microsoft Access and by the Microsoft Jet database 
engine.
'Not all error codes are included in the resulting table,
'as some exist outside the range of error codes evaluated by this 
procedure (0 to 4500).

Function AccessAndJetErrorsTable() As Boolean
    Dim dbs As Database, tdf As TableDef, fld As Field
    Dim rst As Recordset, lngCode As Long
    Dim strAccessErr As String
    Const conAppObjectError = "Application-defined or object-defined error"

    On Error GoTo Error_AccessAndJetErrorsTable
    ' Create Errors table with ErrorNumber and ErrorDescription fields.
    Set dbs = CurrentDb
    Set tdf = dbs.CreateTableDef("AccessAndJetErrors")
    Set fld = tdf.CreateField("ErrorCode", dbLong)

    tdf.Fields.Append fld
    Set fld = tdf.CreateField("ErrorString", dbMemo)
    tdf.Fields.Append fld

    dbs.TableDefs.Append tdf
    ' Open recordset on Errors table.
    Set rst = dbs.OpenRecordset("AccessAndJetErrors")
    ' Loop through error codes.
    For lngCode = 0 To 9900
        On Error Resume Next
        ' Raise each error.
        strAccessErr = AccessError(lngCode)
        DoCmd.Hourglass True
        ' Skip error numbers without associated strings.
        If strAccessErr <> "" Then

            ' Skip codes that generate application or object-defined errors.
            If strAccessErr <> conAppObjectError Then
                ' Add each error code and string to Errors table.
                rst.AddNew
                rst!ErrorCode = lngCode
                ' Append string to memo field.
                rst!ErrorString.AppendChunk strAccessErr
                rst.Update
            End If
        End If
    Next lngCode
    ' Close recordset.
    rst.Close
    DoCmd.Hourglass False
    RefreshDatabaseWindow
    MsgBox "Access and Jet errors table created."

    AccessAndJetErrorsTable = True

Exit_AccessAndJetErrorsTable:
    Exit Function

Error_AccessAndJetErrorsTable:
    MsgBox Err & ": " & Err.Description
    AccessAndJetErrorsTable = False
    Resume Exit_AccessAndJetErrorsTable
End Function

Beach Access Software wrote:

>Dear List:
>
> 
>
>Does anyone have a link to a good list of error codes and descriptions?  
>
> 
>
>Client is getting 2585 but the description is Chinese.
>
> 
>
>Rocky
>
> 
>
>  
>

-- 
Marty Connelly
Victoria, B.C.
Canada

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.408 / Virus Database: 268.13.4/476 - Release Date: 10/14/2006
 




More information about the AccessD mailing list