That dredded "You do not have exclusive access" problem again...!!!

Tsango

Registered User.
Local time
Today, 08:18
Joined
Mar 31, 2006
Messages
64
I am getting the message "You do not have exclusive access to the database at this time" whenever I try to make changes to my forms.

This problem only happens after I run the following statements and I get the message "Cannot access C:\SALON-NET\Data\Salon-Net_be.mdb; file already in use"

Dim wrkJet As Workspace
Dim db As Database

Set wrkJet = CreateWorkspace("NewWorkSpace", "admin", "", dbUseJet)
Set db = wrkJet.OpenDatabase("C:\SALON-NET\Data\Salon-Net_be.mdb", True, False, "MS Access;PWD=test01")


Although I have 3 PC's on the network, the database is not shared, and the folders are not shared, and no one else is accessing the database.

If I bypass the statements above then I do not have a problem at all, but I need to run those statements as they are at the start of the main form and they do any updates to the backend database that are requried such as adding fields ect. This is just version control so that if I install the application on another PC it does the same updates to the backend database on that PC also if you see what I mean.

I haven't always had this problem.

I have looked for answers on this forum and the internet for weeks now and still cannot get it sorted out.

I tried unistalling Adobe Accrobat which I have seen suggested (Could something still be hanging around) although another PC has the same problem and that has never had Adobe Acrobat installed on it..!

I have also tried following the advise on the Microsoft site. Renaming the files/moving it to another folder ect

Any ideas?
 
Last edited:
It's actually just got a lot worse today.

It's saying that the backend database is in use now whatever I do and the backend database increased in size from 20meg to 200meg!!!

I cannot even put a combo box on a form without an error occuring...!!
 
Last edited:
Are you setting the DB and wrkJet to nothing when you exit the function? It sounds to me that on normal exit you do but when an Error occurs there's no code to do this also, solution would be to close all variables in the error handler.
On your second post, It sounds like your BE is corrupt.
 
PeterF said:
Are you setting the DB and wrkJet to nothing when you exit the function? It sounds to me that on normal exit you do but when an Error occurs there's no code to do this also, solution would be to close all variables in the error handler.
On your second post, It sounds like your BE is corrupt.

Thanks for your reply.

I compacted and repaired the BE and that seems ok now.

I do set db and wrk to nothing but as you rightly said, if there is an error then this gets missed out so I have moved the line down to the error handler section.

I would have thought that shutting access down and restarting it would sort that out though.

How can I get out of the locked situation I am in now then??
 
Tsango said:
Thanks for your reply.

I compacted and repaired the BE and that seems ok now.

I do set db and wrk to nothing but as you rightly said, if there is an error then this gets missed out so I have moved the line down to the error handler section.

I would have thought that shutting access down and restarting it would sort that out though.

How can I get out of the locked situation I am in now then??

After re-reading your first post I'm not sure which file you are updating, if you're trying to update the BE trough code from the FE I think your locked state will be normal. If you're updating the FE this wouldn't be normal but I've seen some strange results when the FE is placed on the server, is the BE on the server and the FE on a local drive?
 
PeterF said:
After re-reading your first post I'm not sure which file you are updating, if you're trying to update the BE trough code from the FE I think your locked state will be normal. If you're updating the FE this wouldn't be normal but I've seen some strange results when the FE is placed on the server, is the BE on the server and the FE on a local drive?

There isn't anything on the server. I don't have a server. I am woking on a standalone PC

The bit of code I showed above is in the FE which opens a connection to the BE so that fields can be added if required to the BE tables. It then closes the connection and the main form runs. It's just an update routine that checks version numbers and if the version is not upto date the changes are made before the main forms run.

As I said, this used to work ok, but recently it's giving me the errors
 

Users who are viewing this thread

Back
Top Bottom