Getting error 3048: Cannot open more databases

I recently split my database. My form is a calendar with Tab

month view, week view and day view with 42, 7 and 7 subforms, respectively. All of these subforms are unrelated. When a tab is selected, all subforms on that tab are assigned ControlSource

and all other subforms are cleared of it ControlSource

.

The Month View is the only one that gets Error 3048: Cannot open any more databases.

after it loads 23 subforms (there are a few labels, lists and buttons outside Tab

, but I don't think they are significant).

When the Month View tab is selected, the following actions are performed:

  • a 42x2 array filled with date information Long

  • All subforms are cleared of SourceObject

  • For all subforms on the selected tab: Assign it SourceObject

    , then call the function (located in SUBform) up to the most Filter

    . This function calls another function to count the number of records in the subform based on some criteria. This is where the database and recordset are created and traversed several times before the recordset Closed

    .

The subformat contains several text fields with one containing a conditional format for coloring it. Its recording source is the request:

SELECT tblTask.JobNum, tblJob.JobNum, tblTask.Sequence, tblJob.Closed, tblJob.Certified, tblEstimator.SortID, tblDivision.SortID, tblJob.EstimatorID, tblTask.DivisionID, tblJob.JobSite, tblJob.Customer, tblJob.Closed, tblTask.Item, tblTask.ItemDescription, tblTask.StartDate, tblTask.EndDate, tblTask.WeekendWork, tblEstimator.EstimatorNum & "-" & [FirstName] & " " & [LastName] & "\20" & Mid([tblJob].JobNum,3,2) & " JOBS\" AS JobMidFilePath
FROM (tblEstimator RIGHT JOIN tblJob ON tblEstimator.ID = tblJob.EstimatorID) RIGHT JOIN (tblDivision RIGHT JOIN tblTask ON tblDivision.ID = tblTask.DivisionID) ON tblJob.JobNum = tblTask.JobNum
WHERE (((tblJob.Closed)=False))
ORDER BY tblTask.JobNum, tblTask.Sequence, tblTask.StartDate, tblDivision.SortID;

      

Currently, 521 records are returned with this request.

Is my form expected to be unable to handle all of this? Or is there a way to make my form more efficient? I am very lost in what I have to do about this as I need all 42 subforms to load.

Let me know if you need more information. Thanks in advance!

+3


source to share


1 answer


So, the good news is this is a read-only tab of your monthly issue view. This will make it easier to follow my suggestions:

  • Try setting the RecordsetType to Snapshot in the form properties for each of your subforms. This is the easiest way. If that doesn't work, try:

  • Use disabled ADO entries. Take a look at this link:

How to create disabled ADO entries in VBA / C ++ / Java

Basically, you create this disabled recordset, and set your own .RecordSet resource for it:



Set mySubForm.Recordset = myDisconnectedRsObject

      

Since they, by definition, do not support backend connection, you should be able to create as many as you want without increasing the number of databases.

Once you get the first one, you will need to convert all of your Access / Jet queries underlying 42 subforms to disabled recordsets.

+2


source







All Articles