Reputation: 4335
I opened in MS Access a *.mdb file, stating explicitly I wanted to open it as read only in the open file dialog box. Now, I tried to do changes in another place and they always fail to save to the database because MS Access has locked it, as I verified it created a *.ldb file near the *.mdb file.
Is there a way MS Access can open the file as read only without locking it?
Upvotes: 0
Views: 1560
Reputation: 32682
Yeah, you can't do that.
Any ACID compliant database requires locking, and since an Access database is just a file, locking requires writing.
In contrast to SQL server, Access has no NOLOCK
hints or READ UNCOMMITED
isolation to perform ACID incompliant dirty reads.
Even if you mark a file as read-only and reads are unsupported, the LDB file is still created.
You can, of course, address this at the filesystem level, for example by copying the file upon access and working with that copy. Some network file systems allow copy on write, allowing you to have multiple users access the same file, but only commit one version.
Of course, if the file is read-only but lockable, the alternative is opening the file in read-only exclusive mode. That won't generate a LDB, and won't cause conflicts or corrupt reads as all writes by all users are denied. But it won't allow any actions by other users.
Upvotes: 1