?
Solved

Export Access 2010 table to csv with VBA

Posted on 2011-09-16
1
Medium Priority
?
827 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 500 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

765 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