Exclusive Access

DJNickWatt

Registered User.
Local time
Today, 08:41
Joined
Feb 29, 2008
Messages
25
I have a problem which is really REALLY annoying me.

I have created a brand new Access database. I have created a number of forms. When I run the database and use it everything is ok. Then when I try to go into design mode it says

"You do not have exclusive access to the database at this time...."

The database is on my laptop and it is only me who is using it. Can ayone please help.

Vista Ultimate
Access 2007 Professional Plus
 
Check there are no hanging lock files in the location of your database
 
Are you talking about .ldb files? I have never had an issue at work and have created loads of applications in the same manner. The only difference is at work my machine is Windows XP.

Now here's the brain tickler. I have loaded one of the applications I created on my machine at work and the problem doesn't happen. I let it execute as normal then went into the design of a form to try and re-create the same problem but it didn't happen. It only seems to happen on files I create on the laptop.

If I close the database, then open it but don't let it execute then go to design of the form it allows me to make changes. It only happens if I execute the application and then try to go to design view of a form.
 
You aren't using an ADO or DAO connection somewhere in you database, other than using CurrentDb or CurrentProject.Connection?
 
You aren't using an ADO or DAO connection somewhere in you database, other than using CurrentDb or CurrentProject.Connection?

I am using an ActiveX control (GridEx 2000b from Janusys) which is using an ADO Connection to connect to a back-end database. Again I have used this in numerous projects and the problem has never happened.

I am also opening a DAO.Database connection to the backend. It is declared as a Public as I keep it open while the app is open. I do close it when the main form is closed. Example

Public oRemoteDB as DAO.Database

Set oRemoteDB = OpenDatabase("THEFILENAME.accdb")

Again I have done this before and everything has worked before.
 
Took ages to work this one out.

Thanks Bob you got me in the right direction.

The GridEx component wasn't releasing the ADO connection. To cut a long story short basically the component allows you to store its setup (layout, data mode etc) into a layout file which can then be loaded when creating a new control, so that you don't have to re-create all the settings again.

When I was loading the settings from a GridEx control in another project into my new one it was causing the exclusive access problems. Don't know why but simply unbinding the control, saving the form then rebinding to the back end database has solved the problem.
 
Glad you got it sorted. That can be a real pain sometimes figuring out what is using a persistent connection.
 

Users who are viewing this thread

Back
Top Bottom