By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,930 Members | 1,383 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,930 IT Pros & Developers. It's quick & easy.

Database has been placed in a state by user error

P: 9
Hello,

I'm recieving the following run-time error:

Database has been placed in a start by user 'Admin" on machine 'Machine' that prevents it from being opened or locked.

This is the code that I get the error on

MyDB = "H:\DataManagement.mdb"
strCnn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & MyDB
cnn1.Open strCnn

and the error is on cnn.1.Open.strCnn

Does anyone know what I might be doing wrong?
Dec 2 '08 #1
Share this Question
Share on Google+
9 Replies


Expert 100+
P: 1,287
Check your default open mode in Access settings and make sure it is shared rather than exclusive.

If that's not it, the last post in this thread
access multiuser ...a state that prevents it from being opened or locked...
mentions this may be caused by PDFMaker, but I got rid of the ribbon so I haven't experienced this problem.
Dec 2 '08 #2

FishVal
Expert 2.5K+
P: 2,653
@ ejamnadas

Just out of curiosity. Is DataManagement.mdb the same database where the code resides?
Dec 2 '08 #3

P: 9
Thanks for the replies. Chip, I checked the default access mode, it is set to shared. Also, I have dont have adobe acrobat installed (only reader).

FishVal,

Yes, this is the same database the code resides.

Here is some more information i'm not sure is helpful or not. This is the err.description error I recieve when I first open the database:

"The item cannot be found in the collection corresponding to the requested name or ordinal". After that, I recieved the "Database has been placed in a state by user" error.

Now after I close the database and reopen:

I only recieved "The item cannot be found..." error. But when I remove "On Error..." code, or unless swich to design mode, and then switch back to to view mode, at which point I recieved the "database has been placed in a state.." run-time error.


-ejamnadas
Dec 2 '08 #4

FishVal
Expert 2.5K+
P: 2,653
So, it is you the user that "has placed databasein a state ... ". :)
Database goes in locked state when there is an unsaved object in it. In your case it is code module where you write your code.

BTW, there is no need to open connection as soon as there is already opened one. Even two.
  • ADO connection accessible via CurrentProject.Connection property.
  • DAO connection accessible via Currentdb.Connection property.
There is really no reason to open an additional connection.

As for the 2nd error - there is no place in the code you've where it could happen.

Regards,
Fish
Dec 2 '08 #5

Expert 100+
P: 1,287
I tried using the CurrentProject.Connection property to get a list of the workstations connected to the backend with
Set records = CurrentProject.Connection.OpenSchema(adSchemaProvi derSpecific, _
, "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
but it only returned one record. Is there any way to get to all the connected users without making another connection?
Dec 2 '08 #6

FishVal
Expert 2.5K+
P: 2,653
Hello, ChipR.

I've not tested it myself.
But code posted here definitely doesn't create new ADO connection.
I more than sure that the author has provided a well tested code snippet. :)
Dec 2 '08 #7

Expert 100+
P: 1,287
I just realized, it does make sense that CurrentProject.Connection is showing me only 1 user connected because it's the connection to the front end I'm running, rather than to the back end. Do you happen to know if it's possible to access the connection that linked tables are currently using if I have a form that keeps a connection open?
Dec 2 '08 #8

FishVal
Expert 2.5K+
P: 2,653
I guess it is DAO connection which doesn't support OpenSchema method.
Dec 2 '08 #9

P: 9
Fishval, Thank you for the help.

The currentdb.execute command did work.
Dec 3 '08 #10

Post your reply

Sign in to post your reply or Sign up for a free account.