Link to home
Start Free TrialLog in
Avatar of widya
widya

asked on

Sharing violation on NT

I have an MS Access file on Windows NT 4.0 server that cannot be open, deleted or renamed. Anyway, when I copy this file to other directory it can be open, rename, etc. as usual. when I deleted it, no matter in Explorer or in Command line box, it said there's a "sharing violation".

I have taken the ownership of this file, taken ownership of every file in that directory, then, I removed a share on that directory. It didn't work. So,

1. How can I solve this problem? Does rebooting help?
2. How to prevent or identify which files now having this problem (my network has a lot of files that not so frequently used but when it is, it's urgent.)

Thank you in advance
Widya
Avatar of greebo
greebo

Widya,

Go to Administrative Tools > Server Manager then double-click on the machine you wish to view and go to 'In Use', and you will see all the files that are open and which have been locked, you will also get the opportunity to close the open files.

Hope this helps
you could try installing HandleEx from Sysinternal.com
Another way is if you have access to the server go into [Control Panel] double click [Server] and click [In Use]
It will show you if a computer or user over the network has the file locked. Also look for a file in the same Directory that has a ".ldb" extension which is a file that keeps track of what is locked in your data base. I don't think this file would be the cause of the problem your having. I have had this problem in the past but I don't remember what the fix was.
try this from the command line:

net stop server
del msaccessfile
net start server

Avatar of widya

ASKER

I have already restarted the server now. It solves the problem but It's not a good choice because I had to kick out every users. :( There're only 6 users have access to that file and all were offline. I saw no .ldb and no users connected to the resource (I've already tried what you told me, except the HandleEx, before i ask this question) so I was so sure no one accessed it while the problem persisted. So, could you tell me how NT locks the file? And How to solve it without restart the server. If it's not possible, how to prevent it?

Thank you,
widya
I've had this happen when a user has a file open and their PC crashes or drops off the network. The problem's then due to the fact that the file is registered as opened by that user and a sharing violation error ensues.

It cannot be prevented if a pc crashes, to resolve it replace with copy from backup, or copy and after a period of time you'll be able to delete the file.

Lem
ASKER CERTIFIED SOLUTION
Avatar of Longbow
Longbow

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of widya

ASKER

Sorry for rejecting your answer but I have a reason to do so.

1. the situation about crash workstation(s) locks the files, rendering the files useless will happen (due to my exp.) only when that station has accessed it exclusively and this file is never open exclusively. It used to happen once and at that time, users can still read the files but they cannot write anything into it.

2. Since it's totally locked. restore from backup cannot replace the file because noone, including backup operator can change the file.

Anyway, I thank you for your genorosity.