Yugo
Jul 2 2008, 08:54 AM
Hi guys,
running access 2003 on Win XP
I have a problem with one of the databases I look after... Occaisionally when a users closes the application (either by using the exit command button i have on the main menu (which runs docmd.quit) or the red cross in the top right of the access application) the database closes but the msaccess.exe process stays open in the background (I can see it in task manager) and when that happens it doesn't allow the user to open the database again, until that process is terminated.
It also seems something similar can happen when the user opens the database.... the security warning appears, user clicks open and then the access application disappears but the msaccess.exe process is still running in the background.
This also happens to me even tho i use a different but identical mdb file, so i assume its something to do with the coding of the application. I thought I was leaving a recordset open or not closing a db object but I've checked those and they all seem ok.... I disabled a timer event as well in case that was causing a problem (it seemed to start when i introduced the timer)... but that hasn't helped either.
Anyone got any ideas on how to stop this happening?
strive4peace
Jul 2 2008, 05:16 PM
that is probably happening because you have used object variables in code without (closing and) releasing them...
ie:
if you use a recordset object in code, you need to close and release it
rs.close
set rs=nothing
is you use a db object for CurrentDb(), you need to release it
set db = nothing
Yugo
Jul 3 2008, 05:30 AM
Thanks crystal,
i've noticed it happened once when i simply opened the application to the main menu and closed it so I'm guessing its the code on the autoexec macro that's the problem. I would normally just have 'rst.close' and 'set db= nothing' so I've added a 'set rst = nothing' line and I'll see it that helps.
Regards,
strive4peace
Jul 3 2008, 01:37 PM
you're welcome, Yugo

please let us know if that takes care of the problem
Yugo
Jul 4 2008, 07:06 AM
Unfortuantely not. Still getting the same problem.
I'm going to do some more investigation to see if its a problem with the db not closing properly or the db not opening properly.
Regards,
strive4peace
Jul 4 2008, 12:27 PM
Hi Yugo,
if you want to post the db, we will have a look ...
a database attachment to a UA post has to be:
1. zipped up
2. < 500K
before you zip the file, do Compact/Repair (always do this before you post)
from the menu: Tools, Database Utilities, Compact and Repair Database
if your database is too big to post:
1. make a blank database
2. import the objects necessary to load the form, run the query, open the report, etc and all source objects that pertain to your question
File, Get External Data, Import...
Compact/Repair, then close the database and zip it up
if the file is STILL too big...
1. make a blank database
2. import the objects necessary to load the form, run the query, open the report, etc and all source objects that pertain to your question
File, Get External Data, Import...
on the tables tab of the Import dialog box, click the Options command button and choose 'Structure Only'
3. then create a few sample records in each table -- we do not need data for this question -- just code and macros (and forms)
then Compact/Repair, close it and zip it up
strive4peace
Jul 4 2008, 12:30 PM
Hi Yugo,
generally, anything you use SET to assign needs to be released.
jkribas
Jul 4 2008, 12:51 PM
When leaving the application, instead of using docmd.quit try the application.quit
regards
Jose
Yugo
Jul 11 2008, 05:58 AM
Thanks guys,
The problem seems to have eased of late, or maybe people have just stopped complaining about it.
Crystal - point noted re set/release. Its too big/confidential to post here.
jkribas - have applied your code change as suggested.
regards,
Yugo
Jul 15 2008, 02:30 PM
So this is still happening... :(
Strange thing happened today, one guy got a new PC and this happened everytime he quit the application. I didn't get a chance to check which version of access it was running, but i would think that it was 2003 SP2, which is most of the rest of us have. Strange tho that the behaviour changes depending on the PC don't you think?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.