Newataccess
May 20 2012, 01:46 PM
As I understand it, when you open an access database, a record locking file is created. When the Database is closed, that file is deleted.
Occassionally, when I close my database, then reopen it, the locking file is still in place, so I can't make design changes.
My guess is that either the database itself isn't being closed properly, or when I close a report, etc, something isn't being closed....thus the locking file isn't deleted. (Or there are some permissions that should be changed?)
Just wondered what a good tack is to prevent this.....
Thanks
GroverParkGeorge
May 20 2012, 02:05 PM
Actually, the locking file (laccdb) is created when the FIRST user opens it, and then deleted when the LAST user closes it. So, if you are the ONLY user, this is a problem, but if there are other users, it's to be expected.
A bit more information will be helpful.
Are you the only user?
Are you working with a database that is on a local folder or on a network folder?
Do you have Compact and Repair on close set On?
Newataccess
May 20 2012, 02:08 PM
I am the only user (I'm testing it before creating a BE, FE environment), so right now the program is just on my C drive. Compact and repair is not on.
Thanks
GroverParkGeorge
May 20 2012, 02:12 PM
In that case, the remaining culprit is likely to be closing the accdb improperly, e.g., as might happen if there is a code error from which you recover by killing the accdb from Task Manager, or something similar. ANything like that happening?
I should have asked but I assume this is running in a Trusted Location?
Newataccess
May 20 2012, 02:18 PM
I've been trying to discover when the locking file isn't deleted, and I think I've found the case.
When I'm launching to a report (from a form that specifies the date from the info I want to print in the report), I have added an embedded macro in the OnNoData Event in the Report
MessageBox: "There is no information for this report. Please try again"
CancelEvent
The report does close, apparently....(On the OnClose event, there's also a Macro that launches to a menu form).....
This might help define what I'm doing...
Thanks
Newataccess
May 20 2012, 02:22 PM
Yes, it's trusted. And I'm not forcing the Dbase to close via the TaskManager....
I'm testing this now, trying to determine if the Report Scenario I mentioned is the culprit..
Thanks for the paitence...and assistance.....
GroverParkGeorge
May 20 2012, 02:43 PM
But that should NOT close the database itself.
Macros are pretty straightforward, but we'd have to see the rest of the actions in it to know what it's doing.
Newataccess
May 20 2012, 03:57 PM
I've created a small dbase that demonstrates what I think may be the problem. If you'll look at the OnNoData Event in the report, I think that's what's creating the problem......
Thanks....
Newataccess
May 20 2012, 04:01 PM
Also, I meant to add that it's only when there's no data in the report that the record locking problem is occuring....
Thanks
GroverParkGeorge
May 20 2012, 04:30 PM
I've never heard of this happening. I don't see it happening in your sample. It's HIGHLY unlikely that this is the problem.
To be clear, the .laccdb is not in the folder before you open this database.
It appears when you open the database.
When you close the accdb, you see the .laccdb still sitting in the folder?
If you delete this .laccdb, then open Access and do your work, does it reappear when you close Access again?
Newataccess
May 20 2012, 09:01 PM
Yes, when I close the database, then attempt to re-enter it via the desktop icon, it won't open. When I look in the folder, the .laccdb is present.
I should have said, too, that in database I'm working on (and not in the sample dbase I provided you), I have it split into a FE and BE, and both are in the same folder...
I can, as a matter of fact, enter the ACCESS 2010 program, where I am able to open the accdb. But I can't edit it, since I keep getting the message that the dbase is in use....
Thanks
Newataccess
May 20 2012, 09:42 PM
One more bit of info....
When I use the On No data Event to fire with the message box "No such date, please close report and enter a new date," the macro displays the message then opens the Report (which is empty). And when I close the report, and then close the database, all is well. I can re-enter from the desktop...
So, then, there's something I'm missing past the messge box....
I want to force the report to close by using the macro (as opposed to letting the report open and then closing it manually)
If I add cancelevent, the laccd is present, and I can't edit the dbase.
If I tell the macro (after it posts the message) to close the report, I"m told that's not allowed....and, of course, the laccd is once again present.
Thanks....
GroverParkGeorge
May 20 2012, 10:32 PM
Nothing you've described should have anything to do with this "orphaned" laccdb EXCEPT when you close the database.
"How" do you close it?
Newataccess
May 21 2012, 07:47 AM
I'm usibg a 'Return to Desktop' button....(Quit Access)
BananaRepublic
May 21 2012, 08:02 AM
PMFJI - I want to rule out the possibility that there's an orphaned locking file because the Access database is in a folder that you don't have full rights to.
When you said program is on your C drive, you didn't the root folder "C:\", right? Weird things can happen when it's down there, especially when it's a boot volume. If it's in a folder, check its security just to be sure that you have full rights to it.
GroverParkGeorge
May 21 2012, 08:22 AM
BR is right that you should check on the location, but you have already told me that the files are in a Trusted Location and that you can close and reopen the database normally on some occasions.
So, the next thing is to provide us with a sample copy of the ACTUAL files you are using, where this problem occurs. Obviously, something else is going on besides this one report.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.