Solved

Export Access 2010 table to csv with VBA

Posted on 2011-09-16
1
812 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

739 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