Search code examples
vbams-accessrecordset

Run-Time error '3048' happening even though I close connections


I've been getting an error that I've never seen before. I keep seeing this:

Run-time error '3048':

Cannot open any more databases.

Having Googled it, it seems this happens when there are very complicated forms that have lots of lists or combo boxes that have their sources as a table/query. However, I've not changed these forms for a while now and I'm all of a sudden seeing this. Plus, my forms really aren't that complicated, usually just a single list and maybe 1 or 2 combo boxes. I just started seeing this error yesterday (2/2/22)

Almost in all cases I'm accessing the tables by using this code:

Dim rst As Recordset: Set rst = CurrentDb.OpenRecordset("table name or SQL statement")

Then I'll access data using something like, whether it be AddNew, Edit, or just looping through a recordset.

With rst
    .AddNew
    .Fields("name") = "Value"
End With

OR

Do Until rst.EOF
    'Do something
    .MoveNext
Loop

And I've already double checked that every time I open a recordset I close it

rst.Close
Set rst = Nothing

However, I keep seeing that error now. Is there some other way that I'm supposed to close these recordsets that properly closes the connection? I'm guessing opening these is causing something to linger that I'm not aware of.

the only solution I have right now is to completely restart my PC and then I can use it for a bit before I see the error again.

Thanks for your help!

EDIT: When I get that error, I can't even close everything in Access and manually open a table to look at it. I get this error message

Reserved error (-1104); there is no message for this error.


Solution

  • This is, sadly, a known current bug:

    Access doesn't close properly. A remaining background process can only be terminated in task manager

    There is no official info or remedy yet.