Microsoft Knowledge Base Email Alertz

When you run a macro that uses the TransferSpreadsheet action to export a table or query to the Microsoft Excel file format, you receive the following error message: Cannot update. Database or object is read-only. Cannot update.

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 304146 - Last Review: January 31, 2007 - Revision: 5.3

You may receive a "Cannot update. Database or object is read-only" error message when you use the TransferSpreadsheet action

This article was previously published under Q304146
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

On This Page

SYMPTOMS

When you run a macro that uses the TransferSpreadsheet action to export a table or query to the Microsoft Excel file format, you receive the following error message:
Cannot update. Database or object is read-only.

CAUSE

This error message occurs when one of the following conditions is true:
  • The file name is surrounded with quotation marks, for example "C:\Employees.xls".
  • A carriage return/line feed (CTRL+ENTER) is at the end of the file name in the FileName property.

RESOLUTION

To avoid this error message, when you set the FileName property, insert only the path to the file that you want to export. Do not surround the path with quotation marks or end the line with a carriage return/line feed.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. On the Help menu, point to Sample Databases, and then click Northwind Sample Database.
  2. Create a new macro called TestOutput as follows:
       Action: Transferspreadsheet
       Transfer Type: Export
       Spreadsheet Type: Microsoft Excel 8-10
       Table Name: Employees
       File Name: C:\Employees.xls (insert a carriage return/line feed at the 
                  end of this line by pressing CTRL+ENTER)
       Has field names: No
    					

REFERENCES

For additional information about another cause of this error message, click the article number below to view the article in the Microsoft Knowledge Base:
295200  (http://kbalertz.com/Feedback.aspx?kbNumber=295200/EN-US/ ) ACC2002: "Cannot Update. Database or Object Is Read-Only" Error When You Convert an Uncompiled, Read-only Database

APPLIES TO
  • Microsoft Office Access 2003
  • Microsoft Access 2002 Standard Edition
Keywords: 
kbhowto kberrmsg kbprb KB304146
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate