Exporting a table to a Tab delimeted Text File via code

N

nunYa

I am trying to use the DoCmd.TransferText method to export an access table
to
a Tab Delimited Text File. I have put the code behind the onclick event of
a button
and keep getting the error "Run-time error '32027': Cannot update. Database
or object is read-only"

Code I using is:

Private Sub ExportButton_Click()
DoCmd.TransferText acExportDelim, , "TableName", "c:\export.txt"
End Sub

Am I missing something?
 
R

Ron Kunce

Your code works fine in exporting a text file with comma and double quote
delimiters. Try checking your table for field values containing commas or
double quotes. Check to see if the text file you are writing already exists
and is read-only. You might try prefacing your docmd line with one that
checks for the text file and deletes it, before executing the export
operation.
I am trying to use the DoCmd.TransferText method to export an access table
to
a Tab Delimited Text File. I have put the code behind the onclick event of
a button
and keep getting the error "Run-time error '32027': Cannot update. Database
or object is read-only"

Code I using is:

Private Sub ExportButton_Click()
DoCmd.TransferText acExportDelim, , "TableName", "c:\export.txt"
End Sub

Am I missing something?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top