Solved

how to export query results to a .csv file

Posted on 2007-12-05
5
5,745 Views
Last Modified: 2008-02-01
I need to end up with a csv file that can be used for import and export from one program into another.

I have an access database that reads the data from one program via odbc, massages it and preps it for export into the second program.

there is a query that orders the data for presentation and its the query results that need to end up as the csv file.

I found transfertext, but that only works on tables, not query results.  the table is all text and doesnt export in the correct order.  so I added a query to sort the data.

Any hints?

ACCESS 07 is the version

0
Comment
Question by:Rance_Hall
  • 3
  • 2
5 Comments
 
LVL 26

Expert Comment

by:jerryb30
ID: 20411630
Sure it works on queries.  have you tried?
0
 
LVL 8

Author Comment

by:Rance_Hall
ID: 20411970
Yes I tried, I get and error from the transfertext function, if I name a query instead of a table I get this error:

I got a Run Time Error '2495'

The Action or Method requires a Table Name argument

0
 
LVL 26

Accepted Solution

by:
jerryb30 earned 50 total points
ID: 20412052
Hmmm.  I just did a transfer text with a query in Access 2003.  I cannot see how 2007 would change anything.
Could you maybe have a space in the query name?  Have you enclosed the query name in brackets?
0
 
LVL 8

Author Comment

by:Rance_Hall
ID: 20412547
I dont have a space in the query name, but I didnt have the query name in quotes ("") I didnt think you needed them when there werent spaces, but now its working, thanks for the reminder.

R
0
 
LVL 26

Expert Comment

by:jerryb30
ID: 20412606
Glad to help.  (On my way to the next level.)
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

813 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now