Can't find laccdb file, unable to copy open db (1 Viewer)

CJ_London

Super Moderator
Staff member
Local time
Today, 18:25
Joined
Feb 19, 2013
Messages
16,608
When developing, I sometimes think 'copy the db before running this routine in case something goes wrong'.

Up until a few days ago, this worked fine, open win explorer, copy and paste the db - whilst I'm still in it. no problem.

But now I get the message

'this action cannot be completed because the file is open in Microsoft Access'

Further, I've noticed the .laccdb file is not created when the db is opened but don't know whether this is connected or not, but is also of concern.

Also if I use something like

Shell "cmd /c copy """ & CurrentDb.Name & """ """ & tmpName & ""

this also no longer works - no error is generated and no copy file either. I use this code rather than filecopy because filecopy does generate an error if the file is open.

The last time I know this worked OK was 18 days ago. Since then I have played around with

a) opening FE db's exclusively to see if there was a performance improvement (none that I could detect, think it is more to do with backend performance which can't be exclusive in a multiuser environment)

b) compact on close - for front end to free up space from temp tables - another performance enhancer review, having them local rather than in a local temp db (again no discernible improvement)

in both cases, the appropriate settings have been returned to previous values

Does anyone have any thoughts?
 

sneuberg

AWF VIP
Local time
Today, 10:25
Joined
Oct 17, 2014
Messages
3,506
I'm assuming you're only having this problem with one of your databases. If that's the case do you have the same problem with a copy of the database? I assume you can copy it when you are out of it. And the catch-all everyone hates, have you tried rebooting your computer?
 

Minty

AWF VIP
Local time
Today, 18:25
Joined
Jul 26, 2013
Messages
10,368
I ran into similar issues a while ago after some windows updates. In the end I built a Developer Database that lists my databases and displays last open time, live version numbers, current dev version etc, and manages my copying and updating latest versions.
To get to my point - I copy the target database as a backup before I open it, avoiding the issue.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 18:25
Joined
Feb 19, 2013
Messages
16,608
Thanks for the responses - solved the problem. Sometimes it just helps to talk:)

When experimenting with opening exclusively, I had set the default open mode to the 'open exclusive' options in File>Options>Client Settings in a test db.

Completely forgot this applies to all of (my copy of) access, not just the current db. So when I went back to 'proper' developing, it was still applied.

Changed it back to shared and voila, everything back to normal.

I had been slightly confused by this thread

http://database.ittoolbox.com/group...default-to-open-exclusive-permanently-5348257

where poster said

It was not opened via the "Open File" dialogue box, I went to: File - Options - and changed the default setting to "Open Exclusive". The issue is, how do I make that change remain the default?

Since I had been focusing on performance I hadn't been looking at the file locking aspect

Once again, many thanks

CJ
 

sneuberg

AWF VIP
Local time
Today, 10:25
Joined
Oct 17, 2014
Messages
3,506
Thank for sharing that. This is interesting and good stuff to know. I tried that and confirmed that there's no .laccdb file when opened in that mode. I wonder how the file is lock and whether it's done at the Windows OS level. It also interesting (and stupid) that it only complains when you try to paste the file and not at the copy. It sure would be nice if the message said " is open exclusively" instead of just "is open".
 

CJ_London

Super Moderator
Staff member
Local time
Today, 18:25
Joined
Feb 19, 2013
Messages
16,608
I wonder how the file is lock and whether it's done at the Windows OS level
Think you are right, my guess would be a file property is changed when the file is opened as a windows OS activity. But with Access, multi user is the norm (Excel for example can only have one active user, all susbsequent users will be read only) unless set to exclusive in which case it works like excel (so no need for the locking file). However access can only open with read/write permissions, so subsequent users are locked out.

If I opened the db first from my machine, subsequent users could not open at all.

If I opened the db from a different machine (i.e. client settings as shared) and then tried from my machine, I got a message saying Access already open and given the option of aborting or opening in shared mode.

What would be nice (and what I would have required if opening exclusive had shown performance improvements) is for the exclusive property to be a current database one, rather than a client one.

This would also have had the benefit of being able to have a front end 'template' on the network which users could copy to their machine. It would discourage users from opening the FE on the network (although I have other ways of handling that)
 

Users who are viewing this thread

Top Bottom