How do I lock a file?

  • Thread starter Thread starter Joe Rickford
  • Start date Start date
J

Joe Rickford

Hello I want to lock a file so it cannot be moved during my program runtime... but I do not want to open the file, is there any attribute I can set that locks the file for moving?

Newbie here so go easy, thanks
 
Hi Joe,

If the file is opened as a file, that is automatic done, if it is a database
as an access.mdb, I also will be glad for a solution for that.

Mostly on this question is given the first answer, what is your problem?
(And when it is that access database I have made it clear for others)

Cor.
 
Hi,
One way to do this is to open a file with exclusive read access. IF you
do that then no other program can access your file.
Thanks

Anand Balasubramanian
Microsoft, Visual Basic .NET

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks
 
Back
Top