The database prevents being opened or locked. (1 Viewer)

Sun_Force

Active member
Local time
Today, 21:16
Joined
Aug 29, 2020
Messages
396
Sometimes, when I drag an object (form, report, module, query) from a database to another FE, I receive the following error message:

The Database has been placed in a state by user 'Admin' on machine 'myComputerName' that prevents it from being opened or locked.

The error has OK and Help buttons.
OK closes the error and import fails.
Help sends me to this page and I have no idea what it's saying.

If I close the target database and open it again, this time everything is OK. No error and the object will be imported.

FE is on local drive.
BE is our university's sql server.
No one has access to this FE except me.
Only one instance of the FE is opened. (When I close the FE, lock file disappears)


My questions:
1- What does this a state exactly is?
2- How and why does it happen?
3- Is there any way to bypass this error without closing/opening FE?

thanks.[/b]
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:16
Joined
Oct 29, 2018
Messages
21,357
Not sure if this applies to your situation, but that error sometimes happen when you have some code running to create a lock on a db object or objects.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:16
Joined
May 7, 2009
Messages
19,169
also means you have made changes to the db, by modifying the vba (form/report/module) etc.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:16
Joined
Feb 28, 2001
Messages
26,996
There is an ambiguity in your question. You say... "when I drag an object (form, report, module, query) from a database to another FE"

Are we talking literally drag-n-drop or are you using the External Data option on the ribbon to get the external object?
 

Sun_Force

Active member
Local time
Today, 21:16
Joined
Aug 29, 2020
Messages
396
Are we talking literally drag-n-drop or are you using the External Data option on the ribbon to get the external object?

I had no idea I can import forms or module with import wizard. Good to know it's possible.

Any way the above error occurs when I literally drag and drop an object from one database to another while both are opened side by side.
 

Sun_Force

Active member
Local time
Today, 21:16
Joined
Aug 29, 2020
Messages
396
also means you have made changes to the db, by modifying the vba (form/report/module) etc.

Next time it happens I'll try a compile and then a save to see if it satisfies Access.

thanks.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 12:16
Joined
Feb 19, 2013
Messages
16,553
agree with Arnel, it is the most likely cause. Not sure if compiling will resolve the issue particularly if you have modified a form or report layout in some way, you may still have to close and reopen the target database. You could try saving the target database instead of close/reopen.

EditL Or compact/repair
 
Last edited:

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 12:16
Joined
Sep 12, 2006
Messages
15,613
Occasionally I get corrupted forms when moving controls around, and so on.
I sometimes find I have to delete the form completely, and re-import the form from an old version of the database. It's one reason why it's worth keeping safe archive copies of versions of your database.
 
Last edited:

Sun_Force

Active member
Local time
Today, 21:16
Joined
Aug 29, 2020
Messages
396
thanks for all inputs.
I'll follow them on the next occurrence and see how it goes.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 07:16
Joined
Feb 28, 2001
Messages
26,996
1- What does this a state exactly is?
2- How and why does it happen?
3- Is there any way to bypass this error without closing/opening FE?

1. "A state" is the same as a "status" or "condition" or "situation" or similar terms.
2. By now you have seen several suggestions.
3. Once it reaches "the state" then no. The only way to bypass is to never have it happen.

I suspect that closing and re-opening triggers an auto-compile. More precisely, re-opening the DB and then re-launching the form causes the auto-recompile. Which is consistent with Arnel's comments.
 

Users who are viewing this thread

Top Bottom