I am trying to export a file to .txt using TransferText. My code
looks as follows:
<snippet>
DoCmd.TransferText acExportDelim, "Query1ExportSpecification",
"Query1", "c:\Test\" & sDocName
</snippet>
Now, when I export Query1 "manually" (File --> Export), I get a file
that looks like this (output file has one field):
(Smith) Anderson, Bill: nmt@nowhere.com
Baker, Bill: msb5@somewhere.com
Noel, Joe: nadmin@no.com
When, I use the code above, quotes are inserted in the beginning and
end of each entry, as such:
"(Smith) Anderson, Bill: nmt@nowhere.com"
"Baker, Bill: msb5@somewhere.com"
"Noel, Joe: nadmin@no.com"
I saved the settings for the "manual" export as
"Query1ExportSpecification", in which I specified that text qualifier
was set to {none}.
What do I need to do to get rid of the quotes?
Thanks!
none - 05 May 2007 00:30 GMT
I just wanted to follow up from this post and see if anyone had any
ideas?
Also, was there something wrong with the post? Too easy of a
question? Too confusing of a description? Stumped you?
Thanks!!
Ken Snell (MVP) - 05 May 2007 00:36 GMT
What are you using as the delimiter -- a comma? Try changing to a character
that isn't in the text string.
Are you sure that the no qualifier choice was saved with the specification?

Signature
Ken Snell
<MS ACCESS MVP>
>I am trying to export a file to .txt using TransferText. My code
> looks as follows:
[quoted text clipped - 24 lines]
>
> Thanks!
none - 05 May 2007 02:13 GMT
I do not want a delimiter -- so I have selected {none}. I am using
the same specification to generate the file manually that I do with
the TransferText. I think. :-)
Ken Snell (MVP) - 05 May 2007 02:19 GMT
There is no "none" option for the field delimiter. What is the field
delimiter character?

Signature
Ken Snell
<MS ACCESS MVP>
>I do not want a delimiter -- so I have selected {none}. I am using
> the same specification to generate the file manually that I do with
> the TransferText. I think. :-)
Ken Snell (MVP) - 05 May 2007 02:58 GMT
I just did a test of exporting a table that had commas in a field's values,
and selected "comma" as the field delimiter and "none" as the text
delimiter. Worked as expected -- no " character delimiting the field values.

Signature
Ken Snell
<MS ACCESS MVP>
> There is no "none" option for the field delimiter. What is the field
> delimiter character?
>
>>I do not want a delimiter -- so I have selected {none}. I am using
>> the same specification to generate the file manually that I do with
>> the TransferText. I think. :-)
none - 05 May 2007 04:49 GMT
Thanks for your help on this. It looks like the specification file is
being ignored when I use the TransferText command. I have changed the
text delimiter and saved the spec file and the change is not reflected
when I run the code. It works fine when I go to File --> Export and
chose the Specification file.
When you tried to do the export, what steps did you take?
Thanks!
Ken Snell (MVP) - 05 May 2007 05:11 GMT
I started doing a manual export so that I could create and save the
specification. After saving the specification, I canceled the manual export.
I then ran a TransferText macro to export the table and put the export
specification name as the Specification argument.
> Thanks for your help on this. It looks like the specification file is
> being ignored when I use the TransferText command. I have changed the
[quoted text clipped - 5 lines]
>
> Thanks!
none - 14 May 2007 15:01 GMT
I wanted to give a conclusion to this topic. As it turned out, there
was a problem with the MS Access file that I was working on. I ended
up creating a new file, importing all of the tables, queries, etc, and
then was able to successfully perform the export through
DoCmd.TransferText acExportDelim .
Thanks to all for their help.