You attempted to open a database

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

Hi,
I'm using Office XP. Access 2002. All available updates have been done.
When I try to exit my mdb database I get this error message..
"You attempted to open a database that is already opened exclusively by user
'Admin' on machine 'DELL'. Try again when the database is available."

If I go into Tools...Options ..General Tab and uncheck 'Compact on Close'
I do not get the error message. But I want to compact on close.

There are no other users of this database. It is not shared on my 2 pc home
network.
My pc is named 'DELL'. I am the 'admin'. The folder containing this file is
not shared.

Is there a way to resolve this problem?
Thanks,
Richard.
 
Richard,

Hope you don't mind me writing as I'm not sure of an answer myself, but I
have a horrible feeling that this is what's happening:

It's trying to run the compact process BEFORE the mdb file is closed. In
other words, the 'User ADMIN on machine DELL' is you! Is the mdb file still
open when you get the error message? If it is, that's the answer to why
you're getting the message; given that all you're trying to do is run a
standard option it is baffling. I'll keep an eye on other replies to your
posting since I too would like an answer to this.
 
Hi,
I figured out what was the problem and here's the solution...
I had this line of code in Form_Load:
Set rs = Me.Recordset.Clone
I used rs throughout my coding diffent modules as needed.
I never thought of closing it. I didn't know it was necessary.
Then this evening it hit me....rs is still open and Access thinks it's still
in use...hence the error described below.

"You attempted to open a database that is already opened exclusively by user
'Admin' on machine 'DELL'. Try again when the database is available."

So I put this code in my Form_Close event:
Set rs = Nothing
Then set the Compact on Close option on the general tab.
My database closed with no error!!

I hope this helps some folks,
Richard.
 
Back
Top