PC Review


Reply
Thread Tools Rate Thread

DoCmd.TransferText issue

 
 
JP
Guest
Posts: n/a
 
      17th Apr 2009
I am exporting a csv text file from the results of an access query.
Everything works fine, but the column headings in the text file have illegal
field names in Access. For example Total..Cost Access does not allow me to
have a period in the column name of my query. Is there an easy fix for
this? The file specification for the text file calls for headings with the
period in them. At present, I am creating it without the period, but the
file needs the period to upload properly.

my Code:
DoCmd.TransferText acExportDelim, "", sTable, sFile, True, ""


 
Reply With Quote
 
 
 
 
Ken Snell MVP
Guest
Posts: n/a
 
      17th Apr 2009
Surround the Total.Cost text with [ ] characters in the query for the alias
name:

SELECT FieldName As [Total.Cost]
FROM TableName;

--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/



"JP" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am exporting a csv text file from the results of an access query.
>Everything works fine, but the column headings in the text file have
>illegal field names in Access. For example Total..Cost Access does not
>allow me to have a period in the column name of my query. Is there an
>easy fix for this? The file specification for the text file calls for
>headings with the period in them. At present, I am creating it without the
>period, but the file needs the period to upload properly.
>
> my Code:
> DoCmd.TransferText acExportDelim, "", sTable, sFile, True, ""
>



 
Reply With Quote
 
JP
Guest
Posts: n/a
 
      20th Apr 2009
I get a message stating there are invalid characters. Is there another
method I can use?


"Ken Snell MVP" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Surround the Total.Cost text with [ ] characters in the query for the
> alias name:
>
> SELECT FieldName As [Total.Cost]
> FROM TableName;
>
> --
>
> Ken Snell
> <MS ACCESS MVP>
> http://www.accessmvp.com/KDSnell/
>
>
>
> "JP" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I am exporting a csv text file from the results of an access query.
>>Everything works fine, but the column headings in the text file have
>>illegal field names in Access. For example Total..Cost Access does not
>>allow me to have a period in the column name of my query. Is there an
>>easy fix for this? The file specification for the text file calls for
>>headings with the period in them. At present, I am creating it without
>>the period, but the file needs the period to upload properly.
>>
>> my Code:
>> DoCmd.TransferText acExportDelim, "", sTable, sFile, True, ""
>>

>
>



 
Reply With Quote
 
Ken Snell MVP
Guest
Posts: n/a
 
      20th Apr 2009
Post the entire SQL statement of the query that you're trying to export.
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/


"JP" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>I get a message stating there are invalid characters. Is there another
>method I can use?
>
>
> "Ken Snell MVP" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Surround the Total.Cost text with [ ] characters in the query for the
>> alias name:
>>
>> SELECT FieldName As [Total.Cost]
>> FROM TableName;
>>
>> --
>>
>> Ken Snell
>> <MS ACCESS MVP>
>> http://www.accessmvp.com/KDSnell/
>>
>>
>>
>> "JP" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>I am exporting a csv text file from the results of an access query.
>>>Everything works fine, but the column headings in the text file have
>>>illegal field names in Access. For example Total..Cost Access does not
>>>allow me to have a period in the column name of my query. Is there an
>>>easy fix for this? The file specification for the text file calls for
>>>headings with the period in them. At present, I am creating it without
>>>the period, but the file needs the period to upload properly.
>>>
>>> my Code:
>>> DoCmd.TransferText acExportDelim, "", sTable, sFile, True, ""
>>>

>>
>>

>
>



 
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
Docmd.TransferText JimS Microsoft Access External Data 1 10th Apr 2008 02:45 AM
Help! --- DoCmd.TransferText Arthur Dent Microsoft Access External Data 6 13th May 2007 10:35 PM
DoCmd.TransferText google3luo359@yahoo.com Microsoft Access Form Coding 9 8th May 2006 04:14 AM
VBA Docmd.TransferText =?Utf-8?B?cGdpbGJlcnQxMQ==?= Microsoft Access External Data 5 22nd Mar 2006 08:34 PM
docmd.transfertext Dave Microsoft Access 3 11th Mar 2004 01:50 PM


Features
 

Advertising
 

Newsgroups
 


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