473,396 Members | 1,935 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Runtime Error 3001?!?!?!?

I have written the following code:
Expand|Select|Wrap|Line Numbers
  1. Sub UpdateIL4010DB()
  2.  
  3.     Dim rst As DAO.Recordset
  4.     Dim tbl As DAO.TableDef
  5.     Dim db As DAO.Database
  6.     Dim fld As DAO.Field
  7.     Dim indx As DAO.Index
  8.  
  9.     Set db = CurrentDb
  10.     Set tbl = db.TableDefs("Rid")
  11.  
  12.     Set rst = db.OpenRecordset("Rid", dbOpenTable)
  13.  
  14.     rst.MoveFirst
  15.     Do
  16.         If IsNull(rst![Rcode]) Then
  17.             rst.Edit
  18.             rst![Rcode] = rst![ code ]  'Edited to avoid clash with code tags.
  19.             rst.Update
  20.         End If
  21.         rst.MoveNext
  22.     Loop Until (rst.EOF)
  23.     rst.Close
  24.  
  25. End Sub
The number of records to be read is about 2000000 records, and the runtime error occurs somewhere in the middle.

At first i thought the problem was the database becoming too large with too much data, causing the problem, but then i realised it jumps to over 2GB once the problem occurs. Which means, the problem caused the large size, instead of the other way round.


So i need to know why it caused runtime '3001' in order to make the program run successfully. Please help me!!


Thank you!!!
Dec 9 '08 #1
4 8251
ChipR
1,287 Expert 1GB
Try adding error handling and put a breakpoint in the code to take a look at the record at which the error occurs.
Dec 9 '08 #2
NeoPa
32,556 Expert Mod 16PB
It always helps to include the Error MESSAGE when requesting assistance. I won't insult you by explaining why.

However, it seems clear that you are falling over an Access size problem. Like most database systems it will add changes to the log until the transaction is completed. When it is deemed to have executed fully and without error, it then transfers the updates to the database proper. Clearly this takes up a great deal of space.

I would seriously consider using a query to do this job instead of code. Example code is below. I would ensure that the execution properties are set to 'Use Transaction' = No.

NB. In the following SQL your field "Code" is displayed as having spaces around it to avoid clashing with the site's [ CODE ] tagging. I suggest you always avoid use of such names that are likely to be reserved words anywhere in future.
Expand|Select|Wrap|Line Numbers
  1. UPDATE [Rid]
  2.  
  3. SET [Rcode]=[ code ]
  4.  
  5. WHERE [Rcode] Is Not Null
Welcome to Bytes!
Dec 9 '08 #3
ADezii
8,834 Expert 8TB
@NeoPa
Hello NeoPa, correct me if I am wrong but the code that the OP is displaying is not encapsulated within a Transaction, so there is no Transaction Log per say. The Edit method will copy the Current Record to the copy buffer, and the Update method saves the data from the copy buffer to the Database. The MoveNext Method will discard the contents of the copy buffer (it is not cumulative, is it?). What do you think of the idea to handle this Update in 2 separate processes, namely; create the Recordset, Update the 1st 1,000,000 Records, close the Recordset, then set its Object Variable to Nothing. Duplicate this process for the last 1,000,000 Records. If the Error does not occur, then it is probably a size limitation. Just thinking out loud! (LOL).

P.S. - The funny part is that Error 3001 is defined as: Application-defined or object-defined error', but you know how those Error Messages can sometimes be! (LOL).
Dec 9 '08 #4
NeoPa
32,556 Expert Mod 16PB
In truth, I'm not sure ADezii.

Sometimes transaction processing can be implied, and not very obvious. In this case I was working out (guessing) from the results described.

It could be transaction memory, or it could be poor handling of used, but no longer required, space in Access.

Whichever it turns out to be, the suggestion of doing it in smaller chunks is probably a good one. Let's see how it goes from here.
Dec 16 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Bob Bamberg | last post by:
Hello All, I have been trying without luck to get some information on debugging the Runtime Error R6025 - Pure Virtual Function Call. I am working in C++ and have only one class that is derived...
7
by: wmkew | last post by:
Hello everyone I'm encountering a R6002 Runtime error and several bugs when trying to generate a simple Managed C++ application with .NET 2003. The main problem seems to arise from linking with...
7
by: yuanlinjiang | last post by:
I am working on converting a win32 console application from VC6 to VC7. My version is Microsoft Development Environment 2003 version 7.1.3088. The code works fine on VC6. it is a console...
1
by: joswell | last post by:
Need a little help please! I am getting runtime error 3001 at oRS.filter = ("RM TYP = '" & cell.Text & "'") Private Sub CommandButton5_Click() Application.ScreenUpdating =...
8
by: g_man | last post by:
I am trying trap Runtime error 3022 (duplicates) in the click event of a command button that closes the form. I have code in the Form_Error event that does a good job of providing a more meaningful...
7
by: John | last post by:
Hi Everyone, I'm having this extremely annoying problem with Internet Explorer 6, giving me an error message saying "unknown runtime error" whenever I try to alter the contents of a <divelement...
3
by: Jim Armstrong | last post by:
Hello all - This is driving me crazy. I have a table called tblClients - very simple, has the following fields: taxID (PK) ClientName SalesName The main form of my application allows a...
2
by: blogman | last post by:
I am getting a Visual studio 2008 IDE application R6034 runtime error. This means that the IDE application is raising the error not the application I am building. This means that Microsoft did not...
15
by: dowlingm815 | last post by:
The code below uses a query as a dataset. I have used this code in the past and it works fine. However, it is now generating a error : Invalid Arguement. any suggestions would be appreaciate: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.