Access 97 Query to a tab delimited file

G

Guest

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
then using the PRINT command to write the string to the file.

How can I do something like this to ensure that the file is TAB delimited or
is their and easier way to do this??

I have to include field headings as well, I am not sure if this would matter.

Thanks!
 
J

John Nurick

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
 
G

Guest

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.




:
 
J

John Nurick

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.
 

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