Solved

how to export query results to a .csv file

Posted on 2007-12-05
5
5,741 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
Comment Utility
Sure it works on queries.  have you tried?
0
 
LVL 8

Author Comment

by:Rance_Hall
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Glad to help.  (On my way to the next level.)
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
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 developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…

743 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

8 Experts available now in Live!

Get 1:1 Help Now