Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export data from Access to Fixed Width Text File

Status
Not open for further replies.

needmoremoney

Technical User
Mar 30, 2005
123
0
0
US
I've been using Crystal report to generate fixed width export text files from Access 97 databases.

Is there a better way and easier way to do it?

Is there a way to run a macro to produce such files or with other application that would make this process easier? I need something that would allow me to specify what data to pull, in what format, and etc.?

Let me know. Thanks much.
 
Create a query that gathers and orders and filters your data.

Do a manual Export based on that query so that Access brings up the wizard.
Use the wizard to set up all the parameters and settings that you need.
Before you finish the wizard open the Advanced... setting and save the export specification.

Now in code you can use DoCmd.TransferText and use the name of the query as the data source and the specification that you've defined to control the settings.



'ope-that-'elps.



G LS
spsinkNOJUNK@yahoo.co.uk
Remove the NOJUNK to use.
 
Thanks for the post.

I've tried that. Only one problem. When the file is exported into a fixed width text file, the blank spaces at the end of each record or any and most blank spaces in the record is not counted at a record. This throws of the fix width export file. To test this out, you can place your cursor in the text file and navigate around, you'll see that blank spaces are merged together and not separated.

Any other ideas, let me know. Thanks much.
 
I'm not sure what the problem you are having. Can you try to explain in further detail. For example - Do you have records which are completely null?

When I use this technique it works just fine. I do not have any extra blanks.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top