TransferText defaults

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to use TransferText to export several tables, but I want the tables to
be delimited with a vertical bar ("|"). As far as I can see, there is no
option for that in the TransferText arguments.

Am I missing something? (The export method in VBA for Excel has this
option, so it seems it should be in Access too)
 
Ollie said:
I want to use TransferText to export several tables, but I want the
tables to be delimited with a vertical bar ("|"). As far as I can
see, there is no option for that in the TransferText arguments.

Am I missing something? (The export method in VBA for Excel has this
option, so it seems it should be in Access too)

Export it once via the user interface -- File -> Export... -- and use
the Text Export Wizard to create and save an import/export specification
that specifies the delimiter character you want. Having done that, then
in your code, specify the name of that import/export specification in
your call to the TransferText method.
 
Hi,
you can define a new export specification, and set delimiter to |, and then
use this specification in TransferText method
 
Alex Dybenko said:
Hi,
you can define a new export specification, and set delimiter to |, and then
use this specification in TransferText method
But won't that work for just a single table. That is, the Specification
File contains the names of the fields to be exported. So I really can't use
it for a general case that will allow me to export any table at all.

For example, I can't use;

DoCmd.TransferText (acExportDelim, "NIST_EXPORT", T_Data, File, True)
DoCmd.TransferText (acExportDelim, "NIST_EXPORT", T_Emps, File, True)

That is, I can't use the same Spec file for two different tables.

Or am I wrong about that?
 
Yes,
in this case you have to create specification for each table. To make it
working for any table - you can build specifications in a code, before
export, there are 2 hidden tables where you can add/delete fields
 
Alex Dybenko said:
Yes,
in this case you have to create specification for each table. To make
it working for any table - you can build specifications in a code,
before export, there are 2 hidden tables where you can add/delete
fields

You may also be able to create a schema.ini file to control this, but I
haven't been able to find any good, comprehensive documentation on that.
There are KB articles that give some sample code, but they don't cover
all the details.
 
Back
Top