Microsoft KB Archive/151542

= ACC97: Cannot Link to Tables on Read-Only Media After SR-2 Update Applied =

Article ID: 151542

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Access 95 Standard Edition
 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q151542



Novice: Requires knowledge of the user interface on single-user computers.



SYMPTOMS
When you try to link a table that is located on a read-only drive, a write-protected diskette, or a CD-ROM in Microsoft Access, you may receive the following error message:

Couldn't lock file



CAUSE
The database file's read-only attribute is set to False.



RESOLUTION
Set the read-only attribute of the database file (.mdb) before copying the file to the CD-ROM or diskette. Also, do not include the database's .ldb file. For example, if your database is named Myapp.mdb, do not include Myapp.ldb on the CD-ROM or diskette. Include only Myapp.mdb on the CD-ROM or diskette. Normally, the .ldb files are deleted when the last user closes the mdb.

Steps to Set the Read-Only Attribute
In order to set the read-only attribute, the file must be located on a read/write drive.


 * 1) Start Windows Explorer and select your .mdb file.
 * 2) On the File menu, click Properties.
 * 3) If the Read-Only check box is not selected, click the check box to set the file to Read-Only.



MORE INFORMATION
The symptoms described in this article occur only when linking a Microsoft Access version 2.0 database.

In Microsoft Access 7.0 and 97, you can link a table in a version 7.0 or 97 database that resides on a CD-ROM or write-protected diskette without having to set the read-only attribute of the .mdb. However, it is recommended that you set the read-only attribute of the .mdb file. If you do not set the read-only attribute of the .mdb file, the linked table will appear to be updatable. That is, when viewing the linked table in Datasheet view, you see a blank record at the bottom of the table, indicating that the table is updatable. However, if you try to make changes to the data, you may receive the error, "Couldn't open file," and any changes you make are not saved.

Steps to Reproduce Behavior

 * 1) Copy a Microsoft Access version 2.0 database with at least one table to a floppy disk.
 * 2) Set the write-protection tab on the disk.
 * 3) Start Microsoft Access and create a new database.
 * 4) On the File menu, point to Get External data, and then click Link Data. In the Link dialog box, under Files Of Type, make sure that Microsoft Access is selected. Locate the file, and click OK. Note that you receive the error message mentioned in the SYMPTOMS section.

