Solved

Count open databases in MS Access

Posted on 2016-11-02
7
38 Views
Last Modified: 2016-11-02
An application I have created at work continues to grow (using tabbed rather than overlapping windows) as I expand its functionality and now I am running into the "Cannot open any more databases" message which I understand is because I am touching the limit of 2048 connections with my open forms. So as to know which forms are the major offenders, is there any way I can count the connections by form? If MS Access knows when I am touching that limit then I would have thought there would be a way for me to know.
0
Comment
Question by:Rob4077
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 57
ID: 41869902
<<is there any way I can count the connections by form? If MS Access knows when I am touching that limit then I would have thought there would be a way for me to know.>>

Believe it or not, no.  And it's not connections, but references to tables.

 Every field, control, etc is a reference to  table, so they can add up quickly.

Jim.
0
 

Author Comment

by:Rob4077
ID: 41869918
What a blow! Just for clarification, if I create a complex query but only SELECT a few records from it, is it one connection per SELECTED field or does it count each field in each query?

Also, what is the general approach in a situation like this? Should I just create a second application? Every part of this app is used by all users regularly during the day so if I create a second app it will chew up more resources by having a second instance of MS Access loaded in memory, Or am I better off just changing to overlapping forms and forcing users to close forms as and when they finish with each?
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 41869945
<<is it one connection per SELECTED field or does it count each field in each query?>>

 Each field counts, which is why you don't do SELECT *

<<Or am I better off just changing to overlapping forms and forcing users to close forms as and when they finish with each?>>

  I have to be honest here; bumping into this limit to a certain extent is either a bad DB design, bad development practices (SELECT *, nested queries 7 or 8 levels deep, etc), or an overloaded UI.

  While it's not as rare to bump into this as it once was, it's still pretty rare that someone bumps into this.   Only see one or two of these questions on EE per year.

 I would look at what your doing in the UI and refactoring that.

 This is an internal limit in Access, and there's no work around for it other than that.

Jim.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Rob4077
ID: 41870060
Regretably I am guilty all counts.  I was hoping there was an easy way to quickly identify the main offender. Unfortunately this is the first system I have built in a long time that evolved instead of being designed due to time constraints.  Thanks again for your kind assistance
0
 
LVL 57
ID: 41870113
<<Regretably I am guilty all counts. >>

 Well as a start, look at the queries.   Any place where you have SELECT *  is an easy fix and can give you a drastic reduction of table ID's being used.  Just that may get you by for now.

 I'd then tackle queries where nesting is heavy; anything more than a couple of levels is too much really and anything beyond four is way to much and should be re-done.   And this is so easy to creep into.   "I did that here and will just roll it in".   Then when you stand back and look, it's amazing how much gets repeated in some places.  
 
 While this takes time and analysis because it's easy to break things, it's still one of the simpler fixes overall.

 I'd then move onto the UI and break up complex forms along major functional points.   Popup's can work well here.   Present info to the user in a simplified form, then popup another form with the detail when they want to add/update.  Think about process flow and what the user does.

 Maybe right now everything is on tabs within a single form, where you could take a couple of tabs and split them off to another form.

Jim.
0
 
LVL 57
ID: 41870120
BTW on this

<< I'd then tackle queries where nesting is heavy; >>

The way to approach this is to create a query for each object (form, combo, list box, etc)  and tailor it specifically for that job.

 When you try and re-use query objects for a lot of different things, that's when you start getting extra overhead.  i.e. I need these fields for this, but not for this, and then before you know it, your adding in every field possible.

 Like I said, it's so easy to fall into this.

 You'll end up with a lot more objects in the DB, but it will be fast and efficient that way with the least amount of overhead.

Jim.
0
 

Author Comment

by:Rob4077
ID: 41870236
Thanks for the suggestions.  I will start work on it in the order you said first thing in the morning.  Thanks again
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question