DoCmd.TransferText does not export field names correctly

J

JP

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, ""
 
J

John W. Vinson

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top