473,465 Members | 1,849 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Listing of Access 2003 error codes?

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
8 12462
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
16
by: TD | last post by:
This is the code under a command button - Dim ctl As Control For Each ctl In Me.Controls If ctl.BackColor <> RGB(255, 255, 255) Then ctl.BackColor = RGB(255, 255, 255) End If Next ctl
2
by: Stu | last post by:
Hi, I have an asp.net page that lists all running processes on the server using the script below: Dim p As Process For Each p In Process.GetProcesses sb.Append(p.ProcessName)...
12
by: soccertl | last post by:
Is there a listing of what the compile errors mean? For example: "hdb_log.c", line 163.22: 1506-046 (S) Syntax error. "hdb_log.c", line 160.20: 1506-098 (E) Missing argument(s). make: 1254-004...
7
by: epikto | last post by:
I have a mapped share that I am trying to get a listing of all the files that it contains. I use the following code to access the contents String files = Directory.GetFiles(path); I can then...
3
by: Bobby | last post by:
Hi I'm using Access 2003 with SQL server 2000, linked via ODBC. Can anybody tell me how to capture SQL error codes in Access? If this is not possible, is there any way I can simply turn off SQL...
2
by: BD | last post by:
Hi, all. I'm trying to implement a REFRESH IMMEDIATE MQT to help with performance of a particularly sluggish query. I cannot create it with REFRESH IMMEDIATE, because of reason code "10",...
16
by: John | last post by:
I am looking for VBA code that will work with Access 2003 to enable dragging and dropping a file/folder name from Windows XP Explorer into an Access form's text box. This is a common functionality...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.