AccessBlog.net

News, links, downloads, tips and tricks on Microsoft Access and related

About Me Search
Alex
Name:Alex Dybenko

Location:Moscow, Russia

Tuesday, November 13, 2012

Again on Error 3048: Cannot open any more databases

Once again I was hit by this error - Cannot open any more databases. It was a complex report, same as last time, all DFirst(), DMax() were removed, any calculated expressions were moved to code behind module. This helped for several months, but application is growing and users start to complain on this error. This time it occurred in same report, but when I make PDF file from 3 reports; I open 3 reports in hidden mode, output all three to PDF and merge into one file. If I comment out one report – it works without errors. Or if I close one form and do export it also works. The only explanation I have so far – Access has limited number of "pointers" to current database, each form/report/code opens more "pointers". So when I open 3 reports and then do export – it reaches "pointers" limit and error occurs.

I my case I changed a query in one or report's subreport from using subquery to Group By, and this solved the problem. Do not know for how long, but at least I know what to do next. In worst case I just do all calculations in temporary tables, this will made reports simple and require less "pointers ".

Did you have similar experience? Or maybe you have better explanation/workaround for this effect? Let us know!

Labels: ,

3 Comments:

Anonymous Paul Rohorzka said...

Hi Alex!

When I have had this problem once, I had no clue where exactly the leak occured. I therefore wrote a little helper method that accumulated new references to CurrentDb() until an error occured. The number of successful references gave me information on how many references were currently occupied by my application. By placing calls to this helper on strategic places helped me figure out where the leakage occured.

HTH, Paul

7:47 PM  
Blogger Alex Dybenko said...

Hi Paul,
i also tried this, but there were only 2 or three references while error occurs, so this. I think in my case error message misleading.

12:08 PM  
Blogger Unknown said...

Hi Alex,
I'am also getting same error when I have few forms with lots of sub forms and combo boxes and it drives me nuts. Sometimes there is no error message but instead when you open another form all combo boxes are empty. Still didn't find any good solution but now when I open the form with many sub forms I'm changing recordsources on the fly so when user clicks on some tab
which contains sub form then I bind the data. @Paul is there any possibility that you can send me that helper routine so I can check by myself how many references are open.

7:20 PM  

Post a Comment

<< Home