Solved

Export Access 2010 table to csv with VBA

Posted on 2011-09-16
1
799 Views
Last Modified: 2012-05-12
What's the easiest way in Access 2010 to export a table to a csv file.  I used the following:
    DoCmd.TransferText acExportDelim, , "Std Template RC", "D:\Documents and Settings\204064422\My Documents\GE\Testman Setup Interface\stdTemplate.rc"

But got a message that the table is read only and cannot be exported.  Does this happen when you have the table open on a subform?

Also, if I can get past that problem, will the command above export a .csv or tab delimited?

Thanks.
0
Comment
Question by:janderscu
1 Comment
 
LVL 31

Accepted Solution

by:
Helen_Feddema earned 125 total points
ID: 36552085
I see an extra comma after acExportDelim, which means that you feeding a blank to the tablename argument.  Try using named arguments instead, as in this example:

   DoCmd.TransferText transfertype:=acExportDelim, _
      tablename:="tblCustomers", _
      FileName:="D:\Documents\Examples\Export Delimited.csv", _
      hasfieldnames:=True
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question