Solved

how to export from microsoft access 2010 to txt (tab delimited)

Posted on 2013-01-14
7
5,130 Views
Last Modified: 2013-01-15
hi

i want to export some data from access to some software and i need to format the data in a text tab delimited format, and i tried to do this with this method

DoCmd.TransferText acExportDelim, , "ActionQ", "C:\Query2.txt", True, ""

the code works fine, but the problem is that the data that i exported in the text file is with Quotation mark and commas  around every part of data like this:

"01/01/2012","test"


but i need clean data and just a tab between every cell is there some other method that will export without any extra characters?
0
Comment
Question by:bill201
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38776005
you need to create an export specification first

1.right click on the table
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" , "ActionQ", "C:\Query2.txt", True, ""
0
 

Author Comment

by:bill201
ID: 38776094
thanks for your answer but i prefer do to it with vba code (i will need to do it daily so i prefer to do it with one single code)
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38776100
that is why you need to create an Export Specification first.
after you have created the Specification ,  you will just use


DoCmd.TransferText acExportDelim, "ExportSpecName" , "ActionQ", "C:\Query2.txt", True, ""
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:bill201
ID: 38776166
thanks for your excellent answer

is there some way not to delete the data in the file and just to add the new data in another row?
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 38776183
<is there some way not to delete the data in the file and just to add the new data in another row? > to the text file ?

it can be done, but you need more VBA codes to accomplish that.

and you can not use this command line anymore

DoCmd.TransferText acExportDelim, "ExportSpecName" , "ActionQ", "C:\Query2.txt", True, ""

and i suggest that you post another Q for that purpose
0
 

Author Comment

by:bill201
ID: 38776194
ok maybe i will don't need this code

anyway thanks alot
0
 

Author Comment

by:bill201
ID: 38779349
dear capricorn1

i submit the question again

please give a look in the link http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_27996236.html
0

Featured Post

 Database Backup and Recovery Best Practices

Join Percona’s, Architect, Manjot Singh as he presents Database Backup and Recovery Best Practices (with a Focus on MySQL) on Thursday, July 27, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7). In the case of a failure, do you know how long it will take to restore your database?

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

628 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