UtterAccess Discussion Forums
  UtterAccess Home  | Forums Index  | Search  | Links DB  | FAQs   
Microsoft® Access help forums plus Excel, Word, Outlook®, Visual Basic®, SQL Server®, Office online and... many more!

Access UtterAccess!
New? Welcome!
Join UA here!

Members Login


Password


Remember me!


Search The Database

More Links

  UtterAccess Links
  Link to UtterAccess
  Call UtterAccess Home
  Add UA to Favorites

Quick Jump



UA Recommended

Access Team Blog

UA Recommended

UA's own ScottGem
      and datAdrenaline!

Servers tuned by
Vaultechnology
TransferText Export CSV: need column headers

  TransferText Export CSV: need column headers  Version: 2003 (11.0)

Posted on 12/02/08 05:26 PM
Posted by chongman99 - New Member
Posts: 2 -

Forum: Access Macros
• Edit
• Reply
• Quote
• Quick Reply
• Print this post
• Bookmark Post
• Notify Moderator

• Top of page
I want a general solution to the following problem:

PROBLEM: Export all tables in an .mdb file to CSV ***with column headers***
PARTIAL SOLUTION: I've successfully exported all the tables using a for each loop. The code for my solution is here:

http://opensourceeconomics.wordpress.com/2008/12/02/ms-access-tables-to-stata-for-residential-energy-consumption-survey/

But the thing I can't get is to get the column headers to appear.

I have searched utteraccess and google for solutions, but haven't found one. Two posts on UA are helpful:

*** http://www.utteraccess.com/forums/showflat.php?Board=83&Number=1736578
discusses schema.ini a little, but then found the error was in another argument to TransferText.


*** http://www.utteraccess.com/forums/printthread.php?Cat=&Board=84&main=548339&type=thread
talks about where the specification is stored. (i.e., we can't find it except via the menus) I couldn't find the schema.ini file. I did note that while running the script, a file called export.ini file was created temporarily but then erased.. The other thought is to close all applications, save a new schema, and then look for any files changed in the last 5 minutes; then grep them to find the schema header(???)

BTW: If you want to look at the mdb that I'm using as source data, download it here: http://www.eia.doe.gov/emeu/recs/recs97/publicaccess.html

Thanks!

Re: TransferText Export CSV: need column headers  Version: 2003 (11.0) [Re: chongman99]

Posted on 12/02/08 07:47 PM
Posted by jwhite - Utter Access VIP
Posts: 3965 - Loc: North Carolina, USA

Forum: Access Macros
• Edit
• Reply
• Quote
• Quick Reply
• Print this post
• Bookmark Post
• Notify Moderator

• Top of page
Are you not using the TransferText Method? It has an argument for including field names as the header.

Edit: Duh, re-read title -- you are... Have you tried using that argument for fields?

--------------------
HTH, John | Normalization | FnX Tutorials | Performance Tips

  Re: TransferText Export CSV: need column headers  Version: 2003 (11.0) [Re: jwhite]

Posted on 12/02/08 08:32 PM
Posted by chongman99 - New Member
Posts: 2 -

Forum: Access Macros
• Edit
• Reply
• Quote
• Quick Reply
• Print this post
• Bookmark Post
• Notify Moderator

• Top of page
Quote:

Are you not using the TransferText Method? It has an argument for including field names as the header.

Edit: Duh, re-read title -- you are... Have you tried using that argument for fields?




You are a genius (and I am bad at reading documentation). You solution is 100% correct and I am changing my post and linking back to this page. Thanks!!!

  Re: TransferText Export CSV: need column headers  Version: 2003 (11.0) [Re: jwhite]

Posted on 12/02/08 09:14 PM
Posted by jwhite - Utter Access VIP
Posts: 3965 - Loc: North Carolina, USA

Forum: Access Macros
• Edit
• Reply
• Quote
• Quick Reply
• Print this post
• Bookmark Post
• Notify Moderator

• Top of page


By the way, Welcome to UA!

--------------------
HTH, John | Normalization | FnX Tutorials | Performance Tips


Page Jump
Pages: 1

Navigate
Post List
Previous thread Previous
Next thread Next

Thread Options & Info
• Threaded
• Print Thread

• 395 Thread views

Page Jump
Pages: 1