Solved Accdb: Error Number List (see isladogs) (1 Viewer)

vhung

Member
Local time
Today, 16:30
Joined
Jul 8, 2020
Messages
235
Accdb has prompt error message when something has missed
>using list of access error: error number and error description would help access user identify every error
and probably find best solution posted on internet
 

Attachments

  • errorcodes0.png
    errorcodes0.png
    126.7 KB · Views: 83
  • errorcodes1.png
    errorcodes1.png
    222.9 KB · Views: 87
  • errorcodes2.png
    errorcodes2.png
    241 KB · Views: 95

isladogs

MVP / VIP
Local time
Today, 23:30
Joined
Jan 14, 2017
Messages
18,186

Attachments

  • AccessErrorCodes v3.1.zip
    277.5 KB · Views: 86

Cronk

Registered User.
Local time
Tomorrow, 10:30
Joined
Jul 4, 2013
Messages
2,770
I'm curious. Any reason why

Code:
? error (3211)
Application-defined or object-defined error

give a different, albeit less explicit, response than that listed in your table of error codes?
Code:
The database engine could not lock table '|' because it is already in use by another person or process.
 

vhung

Member
Local time
Today, 16:30
Joined
Jul 8, 2020
Messages
235
@vhung
That appears to be my error code utility with a modified interface. It would be appreciated if you could acknowledge the original source & provide a link. Just posting a screenshot is of no use to anyone...

See http://www.mendipdatasystems.co.uk/access-error-codes/4594398126 or https://www.access-programmers.co.uk/forums/threads/access-error-codes.294824/
succeeded
>32682 highest (rows for my accdb error, only 3038): edited
>glad i fixed it
>i used the codes posted at Mendip Data Systems
 
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 23:30
Joined
Sep 21, 2011
Messages
14,048
succeeded
>32682 rows for my accdb error
>glad i fixed it
>i used the codes posted at Mendip Data Systems
It would have been more appropriate and certainly more truthful to have posted a link to the ACTUAL DB at mendip systems, to assist others, rather than trying to pass it off as your own.? :devilish:

Plus Colin's only has 2976 records, so should be a lot smaller.?
 

isladogs

MVP / VIP
Local time
Today, 23:30
Joined
Jan 14, 2017
Messages
18,186
@vhung
My point was exactly what Gasman said above. I'm happy for you to use my free code & example apps but not to pass them off as your own work without citing the source of the code used.

32682 rows for my accdb error
Incorrect. There are indeed 2976 error records listed when using Access 365 with the highest error number being 32682
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 23:30
Joined
Jan 14, 2017
Messages
18,186
I'm curious. Any reason why

Code:
? error (3211)
Application-defined or object-defined error

give a different, albeit less explicit, response than that listed in your table of error codes?
Code:
The database engine could not lock table '|' because it is already in use by another person or process.

This is only a partial answer...and is not just related to err 3211
If you do err.Raise 3211 you do indeed get the generic error which is of little use to anyone
However the specific error description should appear when that error arises in context e.g. you are trying to add a field to a table using DD code when the table is already open in the application.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 19:30
Joined
Feb 19, 2002
Messages
42,980
Just FYI, When I create error procedures, I always include an else clause that gives me the error number of the error as well as its description so it is easier for me to add the error number to the procedure if I want to trap it in the future.

Code:
Private Sub cboJob_Click()
On Error GoTo ErrProc

''''' my code
    
ExitProc:
    Exit Sub
ErrProc:
    Select Case Err.Number
        Case 2501
            Resume ExitProc
        Case 3167
            MsgBox "This record was deleted and can no longer be selected.", vbOKOnly
            Me.Requery
            Resume ExitProc
        Case Else
            MsgBox Err.Number & "--" & Err.Description
            Resume ExitProc
    End Select
End Sub
 

isladogs

MVP / VIP
Local time
Today, 23:30
Joined
Jan 14, 2017
Messages
18,186
Correction to my response in post #7
In Access 2010, there are 2976 error codes with the highest error number being 32682
In Access 365
, there are 3071 error codes with the highest error number being 32683
 

vhung

Member
Local time
Today, 16:30
Joined
Jul 8, 2020
Messages
235
@vhung
My point was exactly what Gasman said above. I'm happy for you to use my free code & example apps but not to pass them off as your own work without citing the source of the code used.


Incorrect. There are indeed 2976 error records listed when using Access 365 with the highest error number being 32682
yes sir, corrected
>highest error number being 32682
>on your list is 2977 error records, blank code# "See Microsoft KB Article 815281"

>but on my accdb error list 3038 only have this row
generated with from your codes, highest error number being 32682
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 19:30
Joined
Feb 19, 2002
Messages
42,980
Hi Colin,
I ran into an error today that came from some Word automation code and of course the error wasn't in the list of Access errors. I was thinking that if I have time, I might modify your form to add buttons to refresh error collections and in addition to the Access collection, include ADO, Word, and Excel. If I do it, I'll send you a copy.
Pat
 

vhung

Member
Local time
Today, 16:30
Joined
Jul 8, 2020
Messages
235
I was thinking that if I have time, I might modify your form to add buttons to refresh error collections and in addition to the Access collection, include ADO, Word, and Excel.
Pat
this is nice
>could that be delete the Table then create again
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 19:30
Joined
Feb 19, 2002
Messages
42,980
Yes. But right now the table contains only 1 set of error codes. I would load it with at least 3.
 

isladogs

MVP / VIP
Local time
Today, 23:30
Joined
Jan 14, 2017
Messages
18,186
Hi Colin,
I ran into an error today that came from some Word automation code and of course the error wasn't in the list of Access errors. I was thinking that if I have time, I might modify your form to add buttons to refresh error collections and in addition to the Access collection, include ADO, Word, and Excel. If I do it, I'll send you a copy.
Pat
Thanks in advance Pat. That would be useful.
I'd always intended to add ADO errors which IIRC usually (always?) begin with -2147... but couldn't find code to generate it or find a complete list
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 19:30
Joined
Feb 19, 2002
Messages
42,980
Here's the code. I don't remember where I got it. And as I look at it, I'm not sure why it is limiting IngCode to 50000
Code:
Public Function AccessAndJetErrorsADO()
'Add in References MS ADO 2.7 Ext for DLL and Security
'Then paste code:

Dim cat As New ADOX.Catalog 'Data base Catalog
Dim tbl As New ADOX.Table
Dim cnn As ADODB.Connection
Dim rst As New ADODB.Recordset, lngCode As Long
Dim strAccessErr As String

Const conAppObjectError = "Application-defined or object-defined error"
On Error GoTo Error_AccessandJetErrorsTable

Set cnn = CurrentProject.Connection
'Create error
tbl.Name = "AccessAndJetErrorsADO"
tbl.Columns.Append "ErrorCode", adInteger
tbl.Columns.Append "ErrorString", adLongVarWChar

Set cat.ActiveConnection = cnn
cat.Tables.Append tbl
rst.Open "AccessAndJetErrorsADO", cnn, adOpenStatic, adLockOptimistic
For lngCode = 0 To 50000
    On Error Resume Next
    strAccessErr = AccessError(lngCode)
    DoCmd.Hourglass True
    If strAccessErr <> "" Then
        If strAccessErr <> conAppObjectError Then
            rst.AddNew
            rst!ErrorCode = lngCode
            rst!ErrorString = strAccessErr
            rst.Update
        End If
    End If
Next lngCode
rst.Close
DoCmd.Hourglass False
RefreshDatabaseWindow
MsgBox "Access and Jet errors table created."

Exit_accessAndJetErrorsTable:
Exit Function
Error_AccessandJetErrorsTable:
MsgBox Err & ": " & Err.Description
'AccessAndJetErrorsTable = False
Resume Exit_accessAndJetErrorsTable
End Function
 

isladogs

MVP / VIP
Local time
Today, 23:30
Joined
Jan 14, 2017
Messages
18,186
Hi Pat
Thanks for uploading this.
However, your ADO code produces almost the same error list (3081 records in A365) as my DAO code (3071 records in A365).

The 10 record discrepancy is explained as follows
a) I deliberately exclude 16 records with pseudo error descriptions which I think are just place markers for future use:
1601057118857.png

b) More importantly, I have additional code which grabs 6 important generic VBA errors omitted from the standard code which only gets Access specific errors!:
1601057221772.png


For info, I tried looping the full integer range from 0 To 65535 but with the same outcomes
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 23:30
Joined
Jan 14, 2017
Messages
18,186
UPDATE:
I retested both ADO and DAO versions of the code but this time started at the negative long integer limit of -2147483648
The code took a while to run and I interrupted the ADO version before it finished.
However, the DAO version was far faster to complete.

Both sets of code found 87 errors with negative values:
1601069770482.png


However these appear to be identical to the first 87 errors in the standard code.
For example Return Without GoSub is err -2146828285 and err 3. Just add -2146828288 to each to get the standard error value.

In other words there is absolutely no benefit in running this with negative values.
 

Users who are viewing this thread

Top Bottom