GaelicFatboy
Registered User.
- Local time
- Today, 14:13
- Joined
- Apr 17, 2007
- Messages
- 100
Does anyone out there have any ideas on how I can get a full list of the error codes and their descriptions for microsoft access?
I've set up a simple table with two fields, one for the error code and the other for the description. I've written a short bit of code (see below) to build the table for me, but it only generates 88 codes with the highest being 746.
Now I know that there are error codes up in the 3000 area because I'm trapping a few of them.
What I'm looking for is a list of the error code so I may write an extended list in my error trapping routines.
Code as follows:
Private Sub Form_Load()
Dim My_RecordSet As DAO.Recordset, My_DataBase As DAO.Database
Dim My_Error As Long
Dim My_Description As String
For My_Error = 0 To 4000
On Error Resume Next
Err.Raise My_Error
My_Description = Err.Description
If My_Description <> "" Then
If My_Description <> "Application-defined or object-defined error" Then
Set My_DataBase = CurrentDb
Set My_RecordSet = My_DataBase.OpenRecordset("ErrorCode_Table", dbOpenDynaset, dbAppendOnly)
With My_RecordSet
.AddNew
![ErrorCodes] = My_Error 'set error #
![ErrorString] = My_Description 'set error description
.Update
.Close
End With
End If
End If
Next My_Error
End Sub
Cheers muckers
D
I've set up a simple table with two fields, one for the error code and the other for the description. I've written a short bit of code (see below) to build the table for me, but it only generates 88 codes with the highest being 746.
Now I know that there are error codes up in the 3000 area because I'm trapping a few of them.
What I'm looking for is a list of the error code so I may write an extended list in my error trapping routines.
Code as follows:
Private Sub Form_Load()
Dim My_RecordSet As DAO.Recordset, My_DataBase As DAO.Database
Dim My_Error As Long
Dim My_Description As String
For My_Error = 0 To 4000
On Error Resume Next
Err.Raise My_Error
My_Description = Err.Description
If My_Description <> "" Then
If My_Description <> "Application-defined or object-defined error" Then
Set My_DataBase = CurrentDb
Set My_RecordSet = My_DataBase.OpenRecordset("ErrorCode_Table", dbOpenDynaset, dbAppendOnly)
With My_RecordSet
.AddNew
![ErrorCodes] = My_Error 'set error #
![ErrorString] = My_Description 'set error description
.Update
.Close
End With
End If
End If
Next My_Error
End Sub
Cheers muckers
D