Microsoft KB Archive/247861

= ACC97: "Can't Update. Database or Object Is Read-only" Error Message When You Import Files =

Article ID: 247861

Article Last Modified on 1/27/2007

-

APPLIES TO


 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q247861



IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry

Moderate: Requires basic macro, coding, and interoperability skills.



SYMPTOMS
After you install the latest service pack for Microsoft Jet 3.5, when you import text files, you may receive the following error message:

Can't update. Database or object is read-only.

This is followed by:

An error occurred trying to import file. The file was not imported.



CAUSE
The file that you are importing does not have a recognized file name extension.



RESOLUTION
Rename the file name extension so that it matches one of extensions listed in the "More Information" section later in this article.

You can change the file name extension manually or you can use code. Here is an example of code you can use: Sub ChangeExt

Dim OriginalName, NewName, CustExt As String ' Set your custom extension CustExt = "*.cxt" ' Change to the appropriate folder ChDir (InputBox("What folder are the files in", "Locate Files"))

' Retrieve the first entry. OriginalName = Dir(CustExt, vbDirectory)

Do While OriginalName <> ""  ' Start the loop. ' Replace your custom extension with "txt" NewName = Left(OriginalName, Len(OriginalName) - 3) & "txt" Name OriginalName As NewName ' Rename the file OriginalName = Dir   ' Get next entry. Loop MsgBox "Finished renaming files."

End Sub -or-

Modify the following registry key to include the extension of the file that you are importing.

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

HKEY_LOCAL_MACHINE\Software\Microsoft\Jet\3.5\Engines\Text\DisabledExtensions

For additional information about setting this registry key see the More Information section of the following article, click the article number below to view the article in the Microsoft Knowledge Base:

239105 Jet 3.5 Text ISAM Allows Users to Append Lines to System Files



MORE INFORMATION
For security reasons, the latest service pack for Jet (by default) allows only text files with the following extensions to be imported:
 * txt
 * csv
 * tab
 * asc
 * htm
 * html

If you try to import a text file with any other extension, you will receive the error message mentioned in the "Symptoms" section.

Steps to Reproduce Behavior
 Install Microsoft Jet 3.5 Service Pack 3. For additional information about installing this service pack, click the article number below to view the article in the Microsoft Knowledge Base:

172733 Updated Version of Microsoft Jet 3.5 Available for Download

 Click Start, point to Programs, point to Accessories, and then click Notepad.  Type the following text:   1,John,Doe 2,John,Smith 3,John,Jones  Save the file as C:\Test.dat, and then close it. Start Microsoft Access 97.</li> Create a new database.</li> On the File menu, point to Get External Data, and then click Import.</li> In the Files of type list, click Text Files (*.txt;*.csv;*.tab;*.asc).</li> In the File name box, type C:\Test.dat, and then press ENTER.</li> Click Finish. Note that you receive the following error message:

Can't update. Database or object is read-only.

</li></ol>

<div class="references_section">