Database lready opened exclusively by another user Access 2016 RRS feed

  • Question

  • Hi

    I have 4 seperate databases:

    PRGS - forms, queries, reports etc.

    TABS - tables

    SETUP - Client setup regarding what forms they are using

    GEN - printer setups etc.

    TABS, SETUP, GEN all have linked tables within PRGS and all show up great. I have a table within PRGS called Paths and this is where I store the paths of the linked tables (see below).

    Sub checkpaths()
    Dim PathRS As Recordset

    Set PathRS = CurrentDB.OpenRecordset("paths")

    LinkDBPath = PathRS("LinkDbPath")
    SetupDBPath = PathRS("datapath")
    CurrDBPath = PathRS("currdbpath")



    I then refer to tables within the linked databases as follows:

    dim Mydb as database

    Set Mydb = OpenDatabase(LinkDBPath)


    I then get an error saying "the microsoft access database engine cannot open or write to the file. Either opened exclusively or you need permission - error 3051 "

    I can access the tables which reside in these databases via linked tables,  I have checked all file/folder settings and they allow read write etc. and there is only my machine that is trying to access the data.

    Any ideas would be gratefully received.

    Wednesday, January 11, 2017 4:25 PM

All replies

  • Hi Margie,

    I noticed that you are using some codes to manage Access database connection. This forum focuses on general discussion for Office applications.

    To get more suggestion for your issue, I would move your thread to Access for developers forum for further analysis. Hope you can get the solution there :)


    Winnie Liang

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, January 12, 2017 6:17 AM
  • Try Opening it in Shared mode (see: DBEngine.OpenDatabase Method (DAO) for more information)

        Set Mydb = OpenDatabase(LinkDBPath, False)


    Also, could you have a hung/hidden msaccess.exe process on your PC?

    Daniel Pineault, 2010-2016 Microsoft MVP Professional Support: http://www.cardaconsultants.com MS Access Tips and Code Samples: http://www.devhut.net

    Thursday, January 12, 2017 11:38 AM