Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How Do I Test If A File Is Open By Another Process?

How Do I Test If A File Is Open By Another Process?

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelpdatabase
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    John Clump
    wrote on last edited by
    #1

    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!

    N 1 Reply Last reply
    0
    • J John Clump

      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!

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups