By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,543 Members | 2,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,543 IT Pros & Developers. It's quick & easy.

Listing of Access 2003 error codes?

P: n/a
PW
Hi,

There is code in Alison Balter's excellant "Mastering Access 2003" to
create a list of error codes and descriptions but it only generates
error messages 3 through 94. Is there a website with a list of all of
the error messages (with descriptions?).

Thanks,

-paul
Nov 2 '06 #1
Share this Question
Share on Google+
8 Replies


P: n/a
I don't remember where I got this code. If you recognize your code, let me
know and I'll add it to the code.

-----------------------------------
Function AccessAndJetErrorsTable() As Boolean

Dim dbs As DAO.Database, tdf As TableDef, fld As 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 3500
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
---------------------------------------------

PW wrote:
>Hi,

There is code in Alison Balter's excellant "Mastering Access 2003" to
create a list of error codes and descriptions but it only generates
error messages 3 through 94. Is there a website with a list of all of
the error messages (with descriptions?).

Thanks,

-paul
--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via http://www.accessmonster.com

Nov 3 '06 #2

P: n/a
PW
On Fri, 03 Nov 2006 00:20:30 GMT, "ruralguy via AccessMonster.com"
<u12102@uwewrote:
>I don't remember where I got this code. If you recognize your code, let me
know and I'll add it to the code.

-----------------------------------
Function AccessAndJetErrorsTable() As Boolean

Dim dbs As DAO.Database, tdf As TableDef, fld As 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 3500
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
---------------------------------------------
Looks almost identical, except she loops through 10,000. I will give
it a shot. Thanks!

-pw
>PW wrote:
>>Hi,

There is code in Alison Balter's excellant "Mastering Access 2003" to
create a list of error codes and descriptions but it only generates
error messages 3 through 94. Is there a website with a list of all of
the error messages (with descriptions?).

Thanks,

-paul
Nov 3 '06 #3

P: n/a
PW
On Fri, 03 Nov 2006 00:20:30 GMT, "ruralguy via AccessMonster.com"
<u12102@uwewrote:
>I don't remember where I got this code. If you recognize your code, let me
know and I'll add it to the code.

-----------------------------------
Function AccessAndJetErrorsTable() As Boolean

Dim dbs As DAO.Database, tdf As TableDef, fld As 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 3500
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
---------------------------------------------

PW wrote:
>>Hi,

There is code in Alison Balter's excellant "Mastering Access 2003" to
create a list of error codes and descriptions but it only generates
error messages 3 through 94. Is there a website with a list of all of
the error messages (with descriptions?).

Thanks,

-paul
>>AccessAndJetErrorsTable = True
This returns "function call on left-hand side of assignment must
return variant or object".

And, I can't find the table "AccessAndJetErrors"

-pw
Nov 14 '06 #4

P: n/a
Are you calling it from the immediate window with:
?AccessAndJetErrorsTable()

What version of Access are you using?

PW wrote:
>>I don't remember where I got this code. If you recognize your code, let me
know and I'll add it to the code.
[quoted text clipped - 63 lines]
>>>
-paul
>>>AccessAndJetErrorsTable = True

This returns "function call on left-hand side of assignment must
return variant or object".

And, I can't find the table "AccessAndJetErrors"

-pw
--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via http://www.accessmonster.com

Nov 14 '06 #5

P: n/a
ruralguy wrote:
I don't remember where I got this code. If you recognize your code, let me
know and I'll add it to the code.
It's from Access 97 Help, as modified when Access 2000 came out, because
Recordset needed to be changed to DAO.Recordset to disambiguate it from ADODB.
Recordset, the default for Access 2000 and 2002.

--
Message posted via http://www.accessmonster.com

Nov 14 '06 #6

P: n/a
Thanks Granny. Attribute added.

Granny Spitz wrote:
>I don't remember where I got this code. If you recognize your code, let me
know and I'll add it to the code.

It's from Access 97 Help, as modified when Access 2000 came out, because
Recordset needed to be changed to DAO.Recordset to disambiguate it from ADODB.
Recordset, the default for Access 2000 and 2002.
--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via http://www.accessmonster.com

Nov 14 '06 #7

P: n/a
PW
On Tue, 14 Nov 2006 19:32:03 GMT, "ruralguy via AccessMonster.com"
<u12102@uwewrote:
>Are you calling it from the immediate window with:
?AccessAndJetErrorsTable()

What version of Access are you using?
2003. I put the code behind a command button on a form. Do I save the
code as a module first?

>
PW wrote:
>>>I don't remember where I got this code. If you recognize your code, let me
know and I'll add it to the code.
[quoted text clipped - 63 lines]
>>>>
-paul
>>>>AccessAndJetErrorsTable = True

This returns "function call on left-hand side of assignment must
return variant or object".

And, I can't find the table "AccessAndJetErrors"

-pw
Nov 15 '06 #8

P: n/a
It is a function and returns a boolean value. Therefore use
Junk = AccessAndJetErrorsTable()
...to invoke the function from a command button.

PW wrote:
>>Are you calling it from the immediate window with:
?AccessAndJetErrorsTable()

What version of Access are you using?

2003. I put the code behind a command button on a form. Do I save the
code as a module first?
>>>>I don't remember where I got this code. If you recognize your code, let me
know and I'll add it to the code.
[quoted text clipped - 10 lines]
>>>
-pw
--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via http://www.accessmonster.com

Nov 15 '06 #9

This discussion thread is closed

Replies have been disabled for this discussion.