473,387 Members | 1,863 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,387 software developers and data experts.

system resource exceded

232 100+
Expand|Select|Wrap|Line Numbers
  1. Function ASD()
  2. DAO.DBEngine.SetOption dbMaxLocksPerFile, 1500000
  3. CurrentDb.Execute ("ALTER TABLE EMP ADD COLUMN SEQ AUTOINCREMENT")
  4. CurrentDb.Execute ("UPDATE EMP SET SEQ=SEQ+100000")
  5. CurrentDb.Execute ("UPDATE EMP SET SEQ=SEQ+(((SEQ MOD 7)+1)*1000000)")
  6. End Function
it is to generate unique sequence no but the code gives error system resource exceded
kindly help to correct it
Sep 11 '13 #1
13 13441
jimatqsi
1,271 Expert 1GB
Are you calling this function from within a loop? What do you mean by "unique sequence?" Are you trying to get a random number? Your resulting sequence is going to be increasing by at least 1.1 million every time you run this. Is that what you want?

Jim
Sep 11 '13 #2
zmbd
5,501 Expert Mod 4TB
1.5 million file locks... why?

DAO.DBEngine.SetOption dbMaxLocksPerFile, 1500000
You should only call this option ONCE, preferably in the main code module, not every time you execute the function and you should release these resources in the main code.

Also, there is an error NUMBER associated with that error text. Please post BOTH number and text for errors. Many of the errors share the same or similuar text so the number is also required.
Sep 11 '13 #3
Seth Schrock
2,965 Expert 2GB
Possibly using a variable to store the CurrentDb instead of calling it three times would also help.
Expand|Select|Wrap|Line Numbers
  1. Dim db As DAO.Database
  2. Set db = CurrentDb
  3.  
  4. db.Execute ...
  5. db.Execute ...
  6. db.Execute ...
  7.  
  8. Set db = Nothing
I seem to remember that over use of system resources was part of the reason for using the variable instead of just calling the function each time.
Sep 11 '13 #4
zmbd
5,501 Expert Mod 4TB
Seth: I seem to remember that over use of system resources was part of the reason for using the variable instead of just calling the function each time.
Seth you are correct, each call doesn't necessarily return the same pointer so each call can set a new pointer; however, once the scope of the function ends, the resources theoretically release.

We hit on that topic sometime in the first few threads you posted - doesn't seem that long ago.
The old age is catching up with you!
Sep 11 '13 #5
kkshansid
232 100+
its runtime error 3035
system resource exceeded
i also tried method 2 of the link after commenting first line of code
http://support.microsoft.com/kb/815281/en-us
i am also a little bit confused that just by typing the code in immediate window and pressing enter key how come the code run

same error again

it is also to inform that it is the main function of a small program which works fine for 17145 records but now i have to run the same code on 2.5 lakh records
Sep 12 '13 #6
zmbd
5,501 Expert Mod 4TB
- What version of Access are you using?
- You will still need to have the DAO.DBEngine.SetOption dbMaxLocksPerFile, 1500000 called to adjust the file locking. Just move it to a point where it is called only once.
- You shouldn't need to lock 1.5 MILLION records when you are only handling 250,000 records.
- Please do not use regional units such as "lakh", while many in and around south-east Asia and Persia may recognize this to mean 100,000 the rest of the world may not as there is no equivalent in the European numbering system.
- 3035 error... if this is a split database, you may be exceeding the capacity of the server to handle the file locks, especially if it is old, slow, or on a bad communications line. Change your locks back down to DAO.DBEngine.SetOption dbMaxLocksPerFile, 300000 , next open and keep open a record set to a dummy record set, use a table with a single record if needed - you won’t need any information from this record set. This will keep your connection available. Remember to release the dummy connection once the transactions or the session has completed.
-- related to above, if this is a split database, then what are the specifications for the server?
- Please post the entire code where you calling this function from. There are more than likely other issues therein that are also contributing to the problem.
- Please answer jimatqsi's question... Post#2
Sep 12 '13 #7
kkshansid
232 100+
Access 2007 on window 7
this is the main function of the program called only once
yes i want to get unique sequence number
Sep 17 '13 #8
zmbd
5,501 Expert Mod 4TB
this is the main function of the program called only once
Then this should typically be a "Sub" not a function as you are not returning any values.

Did you read thru the remainder of my last post? Did you try reducing the file locks? Did you try the "keep-open" method?

It might help to understand why you are not using an autonumber field and adding records as needed instead of a bulk addition of what appears to be a hundred-thousand blank records.
Sep 17 '13 #9
kkshansid
232 100+
if i make autonumber field it still gives same error
i tried by reducing locks
performing same activity on newly created file
i also tried method 1 of the link by changing registry entry
http://support.microsoft.com/kb/815281/en-us
still same error "system resource exceeded"
kindly explain keep open method in details i will also try that
Sep 23 '13 #10
zmbd
5,501 Expert Mod 4TB
kkshansid
(K): if i make autonumber field it still gives same error (...)
If you still trying to add the same number of records in one go then that doesn't surprise me. The thing with the autonumber is that you should not need to pre-create the records. If you do, then there may be some errors in the table design.
(K): i tried by reducing locks (...)
To what level?
(K): i also tried method 1 of the link by changing (...)
The registry method does the same thing as the method you tried in code; however, the registry method is a more permanent change whereas the code method is only valid while the project is running (and I think within scope too). This is one reason why we suggested pulling the code that set the record lock upperlimit out of the called sub/function and placing it within the calling sub/function code.
The one thing this does help support is that you may simply be exceeding the capacity of the infrastructure you are working with to handle the record writes.
(K): kindly explain keep open method in details (...)
Asked and answered in post#7. Make a single record table, need only have one field, say numeric long (or even byte - for that fact it could be a Boolean field, it doesn't matter) with the number zero for the value. In VBA prior to starting your massive record push, open a recordset to this "dummy" table, keep it open. What I've done for this is to create a form with the dummy table as the record source and records locked with two controls, one hidden and bound to the single record and the other visible. I then use the visible control on this open form as a "message" board for user feed-back. I then close this form once the transactions are completed. However, I haven't had to use this method in over 10 years for two reasons:
1) IT upgraded all of the servers and switches.
2) I learned better database design methods and realized that my database was horribly designed. In fact, I discovered that most of the Databases we were using were poorly design attempts at using Access like we had Lotus123 and Excel.

Major drawback with this method is that once the dummy table is locked like this, only ONE person can have the table locked at a time which defeats the split-database multi-user concept. You also need to put code in place to check for and handle the table being locked should another client attempt to place a lock on the record at the same time or after the first lock is established.
Sep 23 '13 #11
kkshansid
232 100+
Expand|Select|Wrap|Line Numbers
  1. Function SEQGEN()
  2. CurrentDb.Execute ("ALTER TABLE tab1 ADD COLUMN SEQ int")
  3. CNT = 0
  4. Dim rs As ADODB.Recordset
  5. Dim strSQL As String
  6. Set rs = New ADODB.Recordset
  7. strSQL = "SELECT * from tab1"
  8. rs.Open strSQL, CurrentProject.Connection, adOpenKeyset, adLockOptimistic
  9. Do Until rs.EOF
  10. CNT = CNT + 1
  11.     With rs
  12.         !SEQ = CNT
  13.     .Update
  14.     End With
  15. rs.MoveNext
  16. Loop
  17. rs.Close
  18. Set rs = Nothing
  19. MsgBox "FILE PRINTED SUCCESSFULLY"
  20. End Function
after adding 337599 error comes "can not open database it may not be database that your database recognise or the file may be corrupt"
even the simple code is not running kindly tell me if access is not gud for large database
Sep 26 '13 #12
kkshansid
232 100+
even the simple code is not running kindly tell me if access is not gud for large database
Sep 26 '13 #13
zmbd
5,501 Expert Mod 4TB
I think you are not telling us something about the design of your database. I asked about this back in post#7
Is this a split database?

Access2007(32Bit) easily handles 2GB files… Access 2007 specifications

As far as your simple code – although a bit clunky, it ran just fine on my test db… added 150K records in the loop… I tested it twice, once on the local PC and again over my test network on a split database using only the default record locks etc..

It would be better if you start from the beginning here and tell us something about your project. The code you are currently writing... is... to put it kindly... yuuck. If we knew what you were trying to accomplish, other than overloading your infrastructure, then we may be able to offer a better solution.

And before I can help you with any more code you absolutely must read thru the following link, set the "option explicit" ,( you’ll have to add it by hand to the current ones), in all of your code modules, forms, class modules, etc... and then successfully complete a debug/compile. > Before Posting (VBA or SQL) Code – NOTE: You will have to repeat the compile step multiple times to find and fix all of the syntax and usage errors in the code. The compiler stops on the very first error it encounters.

One last thing, why are you using "functions" when you are not returning any values from them to the calling code. Best practice is to use "sub" and then "call" the "sub" from within the main routine.
Sep 26 '13 #14

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

Similar topics

0
by: S.Chang | last post by:
Hi, just a quick question, what kind of system load to expect to run a medium/large scale weblog? the back end servers will be updaing the page quiet often, almost once per minute per servers. ...
1
by: Roberto Ortolano | last post by:
Hello one of our servers (win2k adv server, IIS5, MDAC 2.8, full patched), once a day in the afternoon starts giving this error on every site that uses asp: Microsoft OLE DB Provider for ODBC...
2
by: mark | r | last post by:
Microsoft JET Database Engine error '80004005' System resource exceeded. /webutils/include_webstats_weeklycount.asp, line 23 Anyone know what this means and how to fix it. Mark
10
by: Niall | last post by:
I'm not quite sure which groups to post this to, so short of a massive crosspost, I decided on these two. I am running into troubles with resource usage of our app on Win2k and above systems. In...
4
by: Daniel N | last post by:
I am using a timer to capture the screen, and verify certain criteria through GetPixel(). The timer is set at 333 (about one third of a second). And after running the program, it takes MASSIVE...
2
by: Gucci | last post by:
I need to realize such an effect. if one user has login, the session will keep until he logout. but if i change the set of session.gc_maxlifetime it will take too much system resource. i plan...
3
by: Martin Pöpping | last post by:
Hello, are there any system resource restrictions for running a self coded CSharp programm in Visual Studio? If yes, how can I give my program as much RAM and CPU power als possible? ...
6
by: chengsi | last post by:
Hi guys, I get the "System Resource Exceeded" error when I run a report, but the query which it is based on runs ok (take about 1.5 mins to run tho). Anyone have any suggestions on how to avoid...
11
by: rharding | last post by:
I am getting a "3035 - System resource exceeded" error message when running a DoCmd.TransferText to load a .csv file into a SQL linked table using Access 2003 on Windows 2000. The .csv file contains...
0
by: sivaji | last post by:
i am an engineering student form Indian ,recently i attended one project contest(fossconf) there i came to know that joomla cms is not recommended to use for creating a web application that reads...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.