Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 18th, 2007, 10:22 AM
Authorized User
 
Join Date: Apr 2007
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Default Csv Export

Does anyone know a way to output a query or table in a CSV format? Right now I am just exporting as an excel file, but have to open excel later and save as a csv.

Coby.



 
Old July 20th, 2007, 06:16 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Export it as an xls file, then rename it using Scripting.FileSystemObject. That should work without getting a changing extensions warning. Actually, instead of renaming it, copy and paste it, then delete the xls just to make sure you don't get the warning.

Did that help?

mmcdonal
 
Old July 23rd, 2007, 11:10 AM
Registered User
 
Join Date: Oct 2006
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Coby,

Just export it as a text file

try this

 DoCmd.TransferText acExportDelim, This is for a specification name, "Name of your table or query here", your file name or variable, True if you want filed name - false if not

This will export as a csv file

 
Old July 24th, 2007, 09:11 AM
Authorized User
 
Join Date: Apr 2007
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Great!
Thanks guys . . . I am going to set it up both ways and see how it fits into what my users are doing.



 
Old July 25th, 2007, 08:19 AM
Authorized User
 
Join Date: Apr 2007
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I went with the method of just exporting it as a text file and it was exactly what I am looking for, especially because the column headings are omitted.

I do, however, has other uses for the info given by mcmdonal which gave me some other ideas.

So, I got bonus knowledge on this one.

Thanks you both of your input!

Coby.






Similar Threads
Thread Thread Starter Forum Replies Last Post
DataSet export to .csv file snufse1 ASP.NET 2.0 Basics 3 September 22nd, 2008 07:22 AM
How do I export data from a DataViewGrid to a CSV pauljohns353 VB How-To 1 November 22nd, 2006 11:57 AM
Export To .csv File paul31Hampshire Access VBA 18 June 26th, 2006 11:30 AM
More Export.csv mayhem Morris Access 1 February 24th, 2004 12:52 PM
Export csv grahampinkney Access 3 February 21st, 2004 07:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.