Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export to CSV "error 3027 cannot update, database or object is read on

Status
Not open for further replies.

Poduska

Technical User
Dec 3, 2002
108
US
I can export a table (or query) to a local csv file using the wizard but if I use a macro or VBA I receive the error

Code:
error 3027 "cannot update, database or object is read only"

I have seen treads from people who can and cannot get this to work. For my users the wizard using saved specifications is too confusing.

I tried this code from another thread with the same results.

Code:
Sub transfercsv()
DoCmd.TransferText acExportDelim, , "Tbl_charts", "c:\charts.csv", True
End Sub

What else can I try?

If I could NOT export manually it would be one thing but this is only when automated.

Thanks
 
Poduska:

I just used your example to export an access table to csv without problems.

Sub transfercsv()
'DoCmd.TransferText acExportDelim, , "Tbl_charts", "c:\charts.csv", True
DoCmd.TransferText acExportDelim, , "Ev", "c:\tektips.csv", True

End Sub
 
Poduska:
Did a quick google and found the following:

Is it possible your Table is linked to Excel???

SYMPTOMS
In Microsoft Office Access 2007 or in Microsoft Office Access 2003 or in Microsoft Access 2002, you cannot change, add, or delete data in tables that are linked to a Microsoft Excel workbook.

Additionally, you may experience this behavior when any one of the following conditions is true:• You build a query to retrieve data from tables that are linked to an Excel workbook.
• You build a form that accesses data from tables that are linked to an Excel workbook.
• You use DAO or ADO to update tables programmatically that are linked to an Excel workbook.
 
I DONT UNDERSTAND, I tried and tried my code and it gave me the error all morning, I checked the registry for the "Bolocked extension list" and it still gave me errors.

I copy in your code, which looks the same, and it works.

I am truly sorry for the work I have caused you but thank you for somehow causing my Access to work.

I just closed the database, reopened it and it worked from the macro and code version.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top