Exporting a table to a Tab delimeted Text File via code

  • Thread starter Thread starter nunYa
  • Start date Start date
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?
 
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?
 
Back
Top