Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004

    Unanswered: Stopping an access DB from being locked.


    I've got an application written in VB that connects to a couple of Access databases.

    It all works fine on one PC, but if I try and use it on two at the same time, the second PC won't work because the first one has locked the access database (I can see the lock file in the database folder).

    Is there any way of stopping the database from locking up like this so that both applications can run side by side? I've used the ADODC in VB, and the file is locked by it from the moment the form with that ADODC in it is called.

    Any help would be very gratefully received.

  2. #2
    Join Date
    Feb 2004
    Dorset UK
    With VB you can have dynamic/snapshot and a few other options

    What about using 'snapshot' (I can't remember what the syntax is for that adOpenstatic??) to populate the form, then if the user updates, create an sqlstring, or update code to alter the records ? That way the records are only locked for the spilt second the code runs to update.

    It might not be the best solution, but off the top of my head, and without VB installed I can't give much more help at the mo...(sorry)

    If this doesnt help, let me know and I will dig out my VB disks and re-install it, then I will try and emulate your problem and solve it.



  3. #3
    Join Date
    Dec 2003
    Dallas, TX

    Re: Stopping an access DB from being locked.


    You have the database installed on one pc and it operates fine. What about when you try to access the database from the other pc alone? Is the folder the database is in set to be shared? Check in Tools/Options/Advance and see what is setup Default Open Mode and Default Sharing Mode. Other than that I am not sure what could be the problem because here on my job it resides on a server and all other connect to it. Though it hasn't been split off as FE/BE.


  4. #4
    Join Date
    Feb 2004
    Thanks for the replies folks - been away unexpectedly, hence the slow reply.

    I've managed to fix the problem now - I had an idea to run the actual .exe on one of the network PCs and then the visual studio project on my own simulateneously, so I could debug it. The problem was actually occuring in a backup routine, where the program couldn't get access to the file to copy it - once I removed that, it shared the databases just fine.

    Interestingly, it still creates a lockfile, but that doesn't seem to stop other programs from accessing it.

    You live and learn! Thanks for the assistance though, much app'd

  5. #5
    Join Date
    Sep 2003
    Caldes de Malavella, Spain
    Access databases *always* create a .ldb file when they open.
    Andy Briggs
    Elmhurst Solutions Limited
    Database Development and Consultancy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts