Forum Discussion
NeilClark
Apr 23, 2021Copper Contributor
Cannot Open any more databases
I have built an Access database that is throwing up error code 3048; "Cannot open any more databases". It has been doing it for a couple of years. I am using MS 365 on Win-10 Pro and it is all up to ...
isladogs
Apr 23, 2021MVP
This message often occurs when Access has used up all available connections.
See my utility Available Connections which you can use to check the issue and from that work out what needs to be changed to solve your issues
NeilClark
Apr 23, 2021Copper Contributor
- NeilClarkApr 24, 2021Copper ContributorI have downloaded your Available Connections form and report and plugged them into the offending database and I can now see the connections dropping each time I open another form.
Previously, I have gone right through all of the code and made sure all objects and record-sets were closed and set to nothing when the form was closed. In fact, I can see that this seems to be the case, because when I open and close the forms now, the number of connections reverts to the previous level it was before opening them, so all items have been successfully closed.
The next question is; how do I further reduce the use of connections in my forms. I am obviously building my forms in a way that uses too many connections. How can I reduce that?- isladogsApr 24, 2021MVP
As you may already know, Access has a total of 255 available connections.
Each open object with a record source/row source consumes 1 or more connections.
If the number of available connections drops too far, the error message you are getting may occur.Closing recordsets after use is good practice and, as noted, this should allow Access to recover those connections.
However, your original post stated:
NeilClark wrote:
The system has a number of forms that need to be opened and stay open, so I have them all on large tab control so I can flip between the open forms easily. Most of the forms use combo drop-down boxes as part of the filtering; like a drop-down listing all the staff, so one can be chosen to look at their jobs. And many of the queries under the forms use dynamic lookups to get data from other related tables.Having all of these open at once is likely to be your issue. How many connections does all of this 'consume'?
Remember that subforms are loaded before the main form. So if you have a number of subforms on your tab control together with combos and dynamic lookups you are going to put Access under stress!
I suggest you only load each form as and when needed and close it when moving to another form / tab
OR only load the recordsource for each subform when it is activated. Similarly for your combos/ queries of possible. Then close each of these or clear the row source / record source when you move to another subform / tab
Hope that helps you move forward
- NeilClarkApr 24, 2021Copper ContributorOK - thanks a lot for your wanting to help - it makes a big difference!
I will see how it works if I close each form when I open a new one. That seems to be the only way out that I can see just now. Will let you know how it goes.