Doing away with quotes in export file

N

none

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: (e-mail address removed)
Baker, Bill: (e-mail address removed)
Noel, Joe: (e-mail address removed)

When, I use the code above, quotes are inserted in the beginning and
end of each entry, as such:
"(Smith) Anderson, Bill: (e-mail address removed)"
"Baker, Bill: (e-mail address removed)"
"Noel, Joe: (e-mail address removed)"

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!
 
N

none

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!!
 
K

Ken Snell \(MVP\)

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?
 
N

none

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. :)
 
K

Ken Snell \(MVP\)

There is no "none" option for the field delimiter. What is the field
delimiter character?
 
K

Ken Snell \(MVP\)

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.
 
N

none

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!
 
K

Ken Snell \(MVP\)

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.
 
N

none

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.
 

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