Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 18th, 2007, 10:22 AM
Authorized User
 
Join Date: Apr 2007
Location: , , .
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.



Reply With Quote
  #2 (permalink)  
Old July 20th, 2007, 06:16 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
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
Reply With Quote
  #3 (permalink)  
Old July 23rd, 2007, 11:10 AM
Registered User
 
Join Date: Oct 2006
Location: Leigh, Lancashire, United Kingdom.
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

Reply With Quote
  #4 (permalink)  
Old July 24th, 2007, 09:11 AM
Authorized User
 
Join Date: Apr 2007
Location: , , .
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.



Reply With Quote
  #5 (permalink)  
Old July 25th, 2007, 08:19 AM
Authorized User
 
Join Date: Apr 2007
Location: , , .
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.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:03 AM.


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