Solved

Saving Access 2010 Query Results to a CSV formatted file

Posted on 2013-06-20
2
2,054 Views
Last Modified: 2016-10-23
I have created an Access 2010 query that sends over 800,000 results.  I want to use VBA to run the query and send the results to a comma delimited CSV file.

Do I use the DoCmd.TransferText command to do this?

Thanks

Glen
0
Comment
Question by:GPSPOW
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39263341
<Do I use the DoCmd.TransferText command to do this?> yes, but

you need to create an export specification first..

1.right click on the table/query
2.select export > Text file
   click on Browse and locate the destination folder
3. (you can accept the proposed name or change it)
click Save, then click OK
4. In the export text wizard select the type (Delim / Fixed width)
5. Follow the wizard, before clicking on Finish
     5a .Click Advanced
6. In the Export Specification dialog box Field Information List, correct any descrepancies

7. click save as, give the specification a name <-- this is the specification name that you will use in the command line below


DoCmd.TransferText acExportDelim, "ExportSpecName", "TableQueryName", "C:\myCsv.csv", True
0
 

Expert Comment

by:chris bennetts
ID: 41856518
I have tried this, it does not work.

I have 3 million rows output by a query, and this just crashes when going to "Export Text" and tells me that it can only paste 65000 rows to the clipboard

please advise..

thanks
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

Title # Comments Views Activity
making call from microsoft access to skype for business 5 44
A Function to parse a text string 4 34
Dlookup MSACCESS 5 25
Reference Controls on subforms 7 28
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
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.
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…

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