[AccessD] MSACCESS.EXE Still Visible in Windows Task Manager after DoCmd.Quit Command

jwcolby jwcolby at colbyconsulting.com
Wed Jan 5 14:36:56 CST 2011


 > I am curious as to why this is happening.

Are you a programmer?

My experience is that this occurs when the VBA garbage collector takes a smoke break.  ;)

Seriously, there is this thing called a garbage collector and it is supposed to do things like close 
ADO and DAO recordsets and release the pointers to them.  If you save pointers to controls in 
classes, the GC is supposed to release these pointers when the class closes.

The GC in VBA is notoriously unreliable.  AFAICT it is possible to store a pointer to a control pn a 
form in the class for that form for example and when the form closes it does not correctly release 
these pointers.

When this happens, Access still has objects open internally, forms close "but not really" and so 
Access closes, "but not really".

When this happens, you have no choice but to kill the process in task manager.

The answer is to *ALWAYS* clean up your own mess, close your own objects that have a close method, 
then programmatically set the pointer to that object to nothing.

It is very tough to always do this, and when you forget, Access starts to not close correctly (again).

John W. Colby
www.ColbyConsulting.com

On 1/5/2011 3:11 PM, Brad Marks wrote:
> Occasionally, we notice that an Access 2007 application is still visible
> in the Windows Task Manager after the "DoCmd.Quit acQuitSaveNone" is
> issued.
>
> (Even after waiting 10 minutes after the DoCmd.Quit command is issued)
>
> To the user, the Access application has disappeared, but it still is
> visible in the Windows Task Manager under the Processes Tab
>
> We can, of course, kill off the application in the Windows Task Manager,
> but we would prefer to not do this.
>
> I am curious as to why this is happening.
>
> Is there something that can be done in the Access application to prevent
> this?
>
> Have other people seen this happen?
>
> Thanks,
> Brad
>



More information about the AccessD mailing list