473,387 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Database has been placed in a state by user error

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
9 12268
ChipR
1,287 Expert 1GB
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
2,653 Expert 2GB
@ ejamnadas

Just out of curiosity. Is DataManagement.mdb the same database where the code resides?
Dec 2 '08 #3
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
2,653 Expert 2GB
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
ChipR
1,287 Expert 1GB
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
2,653 Expert 2GB
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
ChipR
1,287 Expert 1GB
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
2,653 Expert 2GB
I guess it is DAO connection which doesn't support OpenSchema method.
Dec 2 '08 #9
Fishval, Thank you for the help.

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

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

Similar topics

14
by: L Mehl | last post by:
I tested a FE/BE application developed in A2000 on a A2002 machine and got this message when exiting the app. Clicking the only available button "OK", exits the application, as intended. The FE...
16
by: Orchid | last post by:
Hello, I have a MS. Access database in XP. When I open the database in design view, users will get an error message & cannot even open the database. Is there any way to solve this problem? ...
5
by: Rey | last post by:
Howdy all. Was wondering if there is any resolution for err 3734: "The database has been placed in a state by user X on machine Y that prevents it from being opened or locked." I've spent...
4
by: ozgur develioglu | last post by:
hi everyone, I've a USER table which contains USERNAME column. I try to keep usernames unique. When I'm adding I new user, I frist go to database and check if that username already exists and if...
5
by: hfk0 | last post by:
Hi, I'm new to ASP.net, SQL Server and visual studio.net, and I'm having problem inserting and storing data from a web form to a SQL database. I created a simple ASP.NET web form, a simple SQL...
1
by: tricard | last post by:
Good afternoon all, I have recently been trying my hand out at the ADO model as before I have only used DAO (just thought I would expand my knowledge a bit). The problem I am having is that...
1
by: teenagelcruise | last post by:
hi, i have a problem with my code which is i cannot update and addnew data into the database but i can delete the data.plz give me an idea.this is my code that i wrote. <html> <head> <meta...
5
by: rm | last post by:
When using ADO in a module inside an Access 2003 database do I need to open a db connection even though I am working with a table inside the same database? I am writing a bit of code to...
2
by: Briansmi1116 | last post by:
I have a database that I created to be used by several people on a network. Every now and then, when someone has it open, and another wants to open it they get this error; "The database has been...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.