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



The information in this article applies to:

  • Microsoft Access 97

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 filename. 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

  1. 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

  2. Click Start, point to Programs, point to Accessories, and then click Notepad.
  3. Type the following text:
       1,John,Doe
       2,John,Smith
       3,John,Jones
    					
  4. Save the file as C:\Test.dat, and then close it.
  5. Start Microsoft Access 97.
  6. Create a new database.
  7. On the File menu, point to Get External Data, and then click Import.
  8. In the Files of type list, click Text Files (*.txt;*.csv;*.tab;*.asc).
  9. In the File name box, type C:\Test.dat, and then press ENTER.
  10. Click Finish. Note that you receive the following error message:
    Can't update. Database or object is read-only.

REFERENCES

For additional information about errors you may receieve, click the article number below to view the article in the Microsoft Knowledge Base:

246634 ACC97: Invalid Page Fault in Text Import Wizard


Modification Type:MajorLast Reviewed:9/26/2003
Keywords:kberrmsg kbprb KB247861