Forum Discussion

NeilClark's avatar
NeilClark
Copper Contributor
Apr 23, 2021

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 date. The system is totally hand built, using VBA, rather than macros. No templates were involved.

 

There is a support case with Microsoft on this, but it was not resolved there. Support Case: 25328611

 

I have done a full compact and repair many times and have even rebuilt the database by opening a new one and importing all the forms, queries, tables, etc. It is a split database that multiple people use, but the problem comes regardless of how many people are on the system - even just one person.

 

I have also increased the MaxLocksPerFile in the registry of the PCs using this database but this did not stop the problem.

 

I read that not closing record-sets and other objects could cause this problem, so I went through all of the code and added a number of closing statements that were missing, but this did not handle it.

 

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.

 

It seems to have gotten worse in the last couple of months, so I am wondering if there was an update that impacted this area.

 

In any case, I would really like to solve this. Can anyone help?

 

I am in Sydney, Australia, by the way, so I may not respond immediately, due to the time zone difference to most users.

 

 

  • NeilClark 

    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's avatar
        NeilClark
        Copper Contributor
        I 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?
    • Harris_St's avatar
      Harris_St
      Copper Contributor

      isladogs 

      Hi, I am having a similar problems. Could I try your utility?

      I tried to download but message stated that the page is not available

      Thanks

      Harris

      • isladogs's avatar
        isladogs
        MVP

        Harris_St 

        Hi
        Sorry about the broken link. My old http website is no longer in use
        The utility is still available from my new website: 

        https://www.isladogs.co.uk/available-connections

        I've also fixed the earlier link

         

        A lot of people have contacted me in the past couple of days about this utility and it can be very useful to diagnose issues.

        However, in case you aren't aware, there is another major bug in the recent update to Office 365 - version 2201 build 14827.20158 - which is triggering the cannot open any more databases error.

        There have been a very large number of forum posts on the issue around the world.

        MS are aware of the issue but have not yet commented publicly on it AFAIAA

         

    • sgldjj's avatar
      sgldjj
      Copper Contributor

      Hi, I downloaded your utility and tried it out.  Works great by the way!  The issue I hope you can help me with is I'm losing 2 connections every 10 seconds with your form being the only thing open in the database.  Is that normal?  Or should I only be losing connections if I have an object, or objects, open that are linked to data in the tables?  If I open your Available Connections database and open the form, it doesn't lose connections every 10 seconds.  Only my databases are doing this (I've tried it out on a few other of my DB's).  I'm nowhere close to an expert but I've used Access quite a bit over the years and I've never encountered this issue.  I've checked and double checked that I'm not leaving any recordsets open (which I'm not - there's only a few instances in my code where I am opening a recordset and I close it and set it to Nothing each time) and I've tried compact and repair.  Also, every time I close Access, the Record Locking Information icon stays... open?  Not sure how to word it but I can't open Access back up until I open Task Manager and End Process.  My form doesn't have any controls on it that are linked to any data in the database.  The form has one button that runs code and when it runs, the connections drop by about 200 to 250 and when i close the form, the connections don't come back and they'll continue dropping by 2 every 10 seconds.  Thanks in advance for any help you can offer!     isladogs 

  • NeilClark 

    That is a lot of connections for each form and you state you have multiple forms open at once.

    No wonder you are having issues

     

    Very few, if any of my forms are that resource hungry.

    Most of my forms use 4 connections. A form with 12 combos uses just 2 connections

    Even a very complex form with 11 subforms only uses 18 connections

     

    I suggest you do a detailed review of your app and consider changing your approach

    Even before the app crashes, performance will suffer as so many connections are in use

     

    If you want to upload a copy of your db with all sensitive data removed, I may be able to make some specific suggestions that may help

  • Mm165516's avatar
    Mm165516
    Copper Contributor
    I created a trust location (folder), and moved my Access file to this folder.
    To my surprise it solve the problem of “cannot open any more database.”
    - To create a trust location.
    - Open a New Access file.
    - File | Options | Trust Center | Trust Center setting | Trusted Locations | Add New Location
    - Browse a new location | OK | OK
    - Restart the computer
    - Move your Access files to the Trusted location (folder) and open your Access file.
    - Note. The trust location should not be on drive C:\
    - I use a folder in Drive D:\

Resources