How Do I Test If A File Is Open By Another Process?
-
Here is a simple question I have had a hard time finding an answer for. I have a program which reads and writes MS Jet DB (.mdb) files. I want to make sure that the files are not in use by another process, and the the program has exclusive access to the file. Is there a function that I can use to determine if the file is open or not? Or should I use the CDaoDatabase functions to see if it is use? I assume I should test the file to see if it is open. I know CFile will return an error, but is there a way to test if the file is open before it is opened? Thanks for any help!
-
Here is a simple question I have had a hard time finding an answer for. I have a program which reads and writes MS Jet DB (.mdb) files. I want to make sure that the files are not in use by another process, and the the program has exclusive access to the file. Is there a function that I can use to determine if the file is open or not? Or should I use the CDaoDatabase functions to see if it is use? I assume I should test the file to see if it is open. I know CFile will return an error, but is there a way to test if the file is open before it is opened? Thanks for any help!
John Clump wrote: Is there a function that I can use to determine if the file is open or not? I'm sure there is a better way to do this, however you could check for a file with the same name as the database, but with a file extension of "
.ldb
". This is file that contains record locking information. It appears when your Access application is open and is deleted when Access is closed. Again I think there is probably a better way to do this, but it is another option. :)
Nick Parker
You see the Standards change. - Fellow co-worker