Normally one can use DoCmd.TransferText to export a query to a text
file. The default format is CSV, but you can use an export specification
(or a schema.ini file) to specify tab-delimited.
To create the export specification, export the query once manually
(File|Export), click the Advanced button in the wizard, and take it from
there.
Or if you're happy using Open, Print # and so on, you can write a
tab-delimited line by doing something like this
Print #1, Field1 & vbTab & Field2 & vbTab & ... & FieldN
>I am trying to programatically export the results of a query to a tab
>delimited file. I have done this comma delimited by simply building a string
[quoted text clipped - 6 lines]
>
>Thanks!
--
John Nurick [Microsoft Access MVP]
Please respond in the newgroup and not by email.
Rick - 29 Mar 2006 19:02 GMT
I don't know if it is my version or not (I am using Access 97) but I have no
Advanced button when I manually select File|export.
I have "OK" or "Cancel" then can select "WIthin the current database" or
"To an external file or database"
If I select external I can change the file type. But I never get an
advanced tab. I do when I import, and have created and used import specs in
this way.
There are a lot of fields, I wish I could just use a spec. I searched High
and low to try to find a way to do that before I posted.
Thanks for the info though. Maybe I am doing something wrong. Might just
be that I am using the wrong version of access.
> To create the export specification, export the query once manually
> (File|Export), click the Advanced button in the wizard, and take it from
[quoted text clipped - 15 lines]
>
> Please respond in the newgroup and not by email.
John Nurick - 29 Mar 2006 20:22 GMT
Access 97's Export Text Wizard certainly has an Advanced button: I've
just clicked it. But you don't get the wizard if you select Save
Formatted in the preceding dialog, the one where you specify the file
type and name.
Which version (service release) do you have? Mine is SR-2.
>I don't know if it is my version or not (I am using Access 97) but I have no
>Advanced button when I manually select File|export.
[quoted text clipped - 31 lines]
>>
>> Please respond in the newgroup and not by email.
--
John Nurick [Microsoft Access MVP]
Please respond in the newgroup and not by email.