top of page

Hanging instance of Access after closing a database (Fixed)

Updated: Aug 15

Description

You close a database and supposedly terminate Access. After that, databases can no longer be opened by clicking on the file in Windows Explorer or on a shortcut. The result is only a lock file (laccdb) visible in Explorer. If you open Access first, databases can be opened from there. The problem has arisen in the last few weeks or months, even with databases that have been working for years.


The reason for this behaviour is a hanging instance of the msaccess.exe, which you can see and terminate in the Task Manager. However, the problem recurs, either constantly or only from time to time.


All Access versions from 2016 to 365 in all current 240x and beta versions seem to be affected, both on Windows 10 and 11. There are several discussions about the problem, e.g.



Cause

There have been reports of this type of problem in the past. The reasons were bugs or the installation of other programs such as Grammarly. However, recently the number of reports has increased dramatically. So we assume that there is a new variant with a much wider distribution.


In the above-mentioned TechCommunity thread the affected user "CampDirector" posted the following scenario:


  1. Close all Access DBs.

  2. Go to Windows Settings, Accessibility (left hand menu).

  3. Click on Text Cursor and enable Text Cursor Indicator "ON"

  4. Open Access DB, then close it.

  5. Trying to open it again does not work, MSACESS.EXE still running, only way is to end task.

  6. To get your computer "back to normal", simply disable Text Cursor Indicator, and Access opens and closes normally.


This scenario is reproducible for several people and also within the AFo team. For some with every database, for others only if they set the Text Cursor size to maximum and not with all databases.


On May 14, Colin Riddington found two more accessibility settings that trigger the hanging task "reliably": Screen Magnifier and Narrator

However, the problem occurs for many people without this accessibility settings enabled. Therefore, there must be also other or root causes.


Status

Microsoft has released a fix with version 2405 build 17628.20110 in the Current Channel on 29th May.

In our tests, the fix has resolved the hanging task in the cases where accessibility features are involved. As written, there must be other cases as well. So if you were affected by the bug, please let us know in a comment whether the new build fixes the problem for you or not.


Workarounds

The only known workarounds are the various ways to forcefully terminate the open or hanging Access task.


Several methods are mentioned in the comments to this article. Caution is advised here, as forcibly terminating tasks can be problematic in two ways: Some methods terminate all running Access tasks, i.e. potentially more than intended, and there is always a residual risk of damaging the affected Access files.


In his comment here, Keimpe Wiersma mentions the easy-to-use API function EndTask to reliably terminate the current Access task from within the application.


Another method to do this is the API function TerminateProcess. Philipp Stiefel explains it in this video and offers an example file: Windows API in VBA – Terminate Process – Workaround for Access Hanging on Close


2,288 views13 comments

13 Comments


xoxidein
Sep 05

This still happening to our users who use Access on a Terminal Server. Version 2408 Build 16.0.17928.20114. Our only solution is to kill Access via the user tab in Task Manager.

Like

jfruiz
Jun 25

I have been suffering this problem on Access 365 (32x) for months and have reviewed the instance that hangs in the task manager, finding that the wait chain points to a problem with splwow64.exe.


It is noteworthy that the executed code did not call any print functions.


The exact message is:


Analyze Wait Chain

....

"MSACCESS.EXE is waiting for another process (splwow64.exe) MSACCESS.EXE (PID:26592) Thread 2916 splwow64.exe (PID: 20848) Thread: -

Like
Replying to

Unfortunately you don't write which build of Office/Access you are using. Since the bugfix was delivered by Microsoft 4 weeks ago, I have been waiting in vain for even a single affected person to confirm or deny its effectiveness. It is therefore completely unclear in how many cases it helps.

Edited
Like

tassimo
tassimo
Jun 12

Maybe there is a connection to SYSTEM.MDW, which is started in the background. I still use this one and it requires login first before the actual database is opened. However, sometimes there is no request to log in and the Access instance remains open without Access appearing on the screen.

Like

I would only recommend using a forced shutdown as a last resort because it can cause damage to any open Access database.

However, to add to the 2 methods described by @Gontran Harvey and @Keimpe Wiersma, you can do this very easily without using PowerShell or any APIs. Instead, run the following from a command prompt, script or shortcut :

cmd /c taskkill /F /IM "msaccess.exe"

It will terminate ALL open instances of Access. If Access isn't running, you will get a message that the process msaccess.exe was not found

Edited
Like
Replying to

I would still far prefer to use either of the other two methods and even then only in the event of a normal close failing leaving a hanging instance.

For info, none of the methods suggested in these comments deletes the lock file.

Like

Keimpe Wiersma
Keimpe Wiersma
May 07

Plagued by this bug, I fixed it by having Access kill its own process when the main form of the application closes. It's very simple. Put this line in a module:


Public Declare Function EndTask Lib "user32.dll" (ByVal hWnd As Long, ByVal fShutDown As Boolean, ByVal fForce As Boolean) As Long


and put these lines in the OnClose event of your main form:


Dim hWnd As Long

hWnd = Application.hWndAccessApp

Call EndTask(hWnd, False, True)


Further information: because the above procedure may damage the Access file, the application is started every time by a .bat file that copies a fresh Access file from the file server to a local directory and launches it.

Like
bottom of page