PC Review


Reply
Thread Tools Rate Thread

DoCmd.TransferText does not export field names correctly

 
 
JP
Guest
Posts: n/a
 
      21st Apr 2009
I need to export the results of a query including field names to a csv text
file. Some of the fields need a period in the caption which is illegal in
access. To get around this (as suggested by others in this newsgroup), I
changed the caption property of the field in my query to include the period.
The period displays in the column heading when I run the query in access.
However, the export does not include the period in the text file.

DoCmd.TransferText acExportDelim, "", sQry, sFile, True, ""


 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      22nd Apr 2009
On Tue, 21 Apr 2009 16:14:23 -0400, "JP" <(E-Mail Removed)> wrote:

>I need to export the results of a query including field names to a csv text
>file. Some of the fields need a period in the caption which is illegal in
>access. To get around this (as suggested by others in this newsgroup), I
>changed the caption property of the field in my query to include the period.
>The period displays in the column heading when I run the query in access.
>However, the export does not include the period in the text file.
>
>DoCmd.TransferText acExportDelim, "", sQry, sFile, True, ""
>


rats... I didin't test it and thought it might work.

You'll need to either postprocess the file or use VBA code to explicitly write
the header record, I fear!
--

John W. Vinson [MVP]
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
TransferText export is truncating field slickdock Microsoft Access Macros 2 14th Aug 2009 10:50 PM
Usng Docmd.transfertext - I get entire file imported into 1 field =?Utf-8?B?R1NTLVNob25kYQ==?= Microsoft Access External Data 2 11th Jul 2007 04:12 PM
Can I use DoCmd.Rename to change the field names in a table? =?Utf-8?B?RGlhbmU=?= Microsoft Access VBA Modules 15 26th May 2006 05:27 PM
TransferText - Export Table to Text File and Include Column Names =?Utf-8?B?a2V2aW50ZWstdGlw?= Microsoft Access VBA Modules 6 18th Apr 2006 07:44 PM
DoCmd.TransferText how does Access determine default field types. =?Utf-8?B?andhbHNo?= Microsoft Access External Data 7 30th Mar 2005 11:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:54 PM.