Error listing

G

Guest

Where can I find a complete listing of all Access error numbers and their
description to print out? I've looked in manuals and the MS knowledge base
and haven't been sucessful? ( I know it's a different newsgroup, but I'm also
wanting a error listing for vb.net also). Thanks in advance......
 
A

Allen Browne

The JET errors and their meanings are listed in the file jeterr40.chm,
typically found in:
C:\Program Files\Common Files\Microsoft Shared\OFFICE11\1033

You can also get a list by looping through:
AccessError(x)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
P

Pat Hartman\(MVP\)

Here is a sub that I copied from a kb article. It creates a table and
populates it with all the Access and DAO error codes:

Function AccessAndJetErrorsTable() As Boolean
Dim dbs As DAO.Database, tdf As DAO.TableDef, fld As DAO.Field
Dim rst As DAO.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 5000
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top