Hi all,
This is a follow up to my post from last September. We have an Access process which we run every day (several times) but for some large data sets we get the above error - System Resource Exceeded.
The process is split into 3 main subroutines - each of which calls a large number of queries - update, append and make table queries. For example we have a routine like the following ;
Generally the process will fall over somewhere in the middle of the 2nd or 3rd routine (which have 100 to 200 queries in them). It doesn't always fall over at the same place but there are a few common places which it might fail at.
I managed to make some progress last year by adding 'Compact and Repair's programatically in between each of the main subroutines. This has helped, however we still see the issue on some of our largest datasets (> 400,000 lines in the main table).
This week I've been trying some other things.
1. I tried using currentdb.execute to call the queries instead of DoCmd.Openquery. This appeared to make no difference - it still failed at the same point.
2. I then tried wrapping each .execute statement in a transaction ;
This just made things worse - it falls over much earlier in the process with the same 'System Resource Exceeded' error.
I also tried changing the Max locks setting first ;
However this made no difference.
3. I also tried, in the Properties of the main query which fails, setting 'Use Transaction' to No (as recommended in a MS Knowledge Base article I found). This also made no difference. (It seemed to help sometimes when I manually run the queries, but if I run the entire process from scratch it still falls over).
My next step is going to be to split the routines into smaller chunks, and call these chunks separately, doing a compact and repair between each one.
However, this is not a very neat solution in my mind, and I know that 'Compact and Repair' is not without its risks (in fact, during this process, we have seen a table being deleted by a Compact and Repair). So I am still looking for that elusive silver bullet that will resolve this. Does anyone have any more suggestions of things that I could try ?
Thanks very much...
StepOne
This is a follow up to my post from last September. We have an Access process which we run every day (several times) but for some large data sets we get the above error - System Resource Exceeded.
The process is split into 3 main subroutines - each of which calls a large number of queries - update, append and make table queries. For example we have a routine like the following ;
Code:
Sub PrepareSummary()
DoCmd.OpenQuery "qryA1"
DoCmd.OpenQuery "qryA2"
DoCmd.OpenQuery "qryA3"
.......
(60 other queries)
.......
DoCmd.OpenQuery "qryZ1"
DoCmd.OpenQuery "qryZ2"
DoCmd.OpenQuery "qryZ3"
DoCmd.OpenQuery "qryZ4"
End Sub
Generally the process will fall over somewhere in the middle of the 2nd or 3rd routine (which have 100 to 200 queries in them). It doesn't always fall over at the same place but there are a few common places which it might fail at.
I managed to make some progress last year by adding 'Compact and Repair's programatically in between each of the main subroutines. This has helped, however we still see the issue on some of our largest datasets (> 400,000 lines in the main table).
This week I've been trying some other things.
1. I tried using currentdb.execute to call the queries instead of DoCmd.Openquery. This appeared to make no difference - it still failed at the same point.
2. I then tried wrapping each .execute statement in a transaction ;
Code:
stSQL = "qryB011_AddTest"
ws.BeginTrans
.Execute stSQL, dbFailOnError
ws.CommitTrans
This just made things worse - it falls over much earlier in the process with the same 'System Resource Exceeded' error.
I also tried changing the Max locks setting first ;
Code:
DBEngine.SetOption dbMaxLocksPerFile, 200000
However this made no difference.
3. I also tried, in the Properties of the main query which fails, setting 'Use Transaction' to No (as recommended in a MS Knowledge Base article I found). This also made no difference. (It seemed to help sometimes when I manually run the queries, but if I run the entire process from scratch it still falls over).
My next step is going to be to split the routines into smaller chunks, and call these chunks separately, doing a compact and repair between each one.
However, this is not a very neat solution in my mind, and I know that 'Compact and Repair' is not without its risks (in fact, during this process, we have seen a table being deleted by a Compact and Repair). So I am still looking for that elusive silver bullet that will resolve this. Does anyone have any more suggestions of things that I could try ?
Thanks very much...
StepOne