transfertext delimited

J

javablood

Hi,

I am trying to import a delimited text file with first row headers into
Access 2007. I am using this:

DoCmd.TransferText acImportDelim, , "S-statistic_" & quarter,
vrtSelectedItem, -1

where quarter is a period that is input from a text box to differentiate the
table from others and vrtSelectedItem is the path and name of the text file.

The file is imported okay but the row headers are not imported and the table
does not keep the same delimited format as the text file. This file imports
correctly using the import wizard so I am not sure what I am doing wrong.

Any help is much appreciated.

Thanks,
 
D

Dale Fye

Will each of the tables that you import contain the same structure? If so,
use the import wizard to create an Import Specification. This should solve
the issue of the format, as the wizard allows you to identify which fields to
import and what their data types should be.

This looks like you are importing to a unique table for each quarter. Why
would you want to do this? In a truly normalized database, you would put all
of the information from the imported table, plus the year/quarter into a
single table, which could then be easily queried. When you import data into
different tables, all with similiar structure, you end up having to do a lot
of extra work.

Personally, I generally import the data into a temporary table (same name
every time), then I run one or more queries to identify potential problems
with the data, and finally run a query that copies all of the data from the
temp table, along with the "quarter" or whatever additional fields you need
in your primary data table.
 

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

Similar Threads


Top