.accdb file creation with OleDbConnection with mode=Read RRS feed

  • Question

  • Hello,

    I have an OleDbConnection string defined as :

    Private DBCon as New OledDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Mode=Read;Data Source = c:\temp\db\Test.accdb")

    c:\temp\db and Test.accdb has only read and execute permission.

    When I do a DBCon.Open() , I get the message  : Cannot lock the file

    However if I change the rights of c:\temp\db to modify and leave the rights of Test.accdb, it works fine. However, Test.laccdb is create in directory.

    Why is a .laccdb file created when I open it in read mode?

    Tuesday, September 22, 2020 3:22 PM

All replies

  • The creation of an .laccdb file has nothing to do with folder rights or connection strings. Any time you open a .accdb file, it creates an .laccdb file for that ACCESS database. It goes away when you close the database.
    Tuesday, September 22, 2020 4:18 PM
  • If you open an database interactively which resides in an read-only directory, it opens the DB in read-only and no .laccdb is created
    Wednesday, September 23, 2020 7:40 AM