Importing textfiles into database

  • Thread starter Thread starter Viaene
  • Start date Start date
V

Viaene

Is there any restriction on the number of fields in
a 'target table' of a TransferText-action? Having problems
with importing a textfile (on an semi-automatic way by
clicking in a form and running VB-code from a class-
module) I started from a newly created table containing
only three fields, with the same names of the fields to
import from the textfile. This worked well. Afterwards I
gradually added a new field in the target table (this
extra fields didn't appear in the textfile to import).
When I arrived at the forteenth field, the TransferText
action caused an error message saying that "Not all data
were added to the table. the content of 0 records was
removed and 0 records were lost due to keyconflicts". So
all data were imported, but I keep getting the error
message. Where is the problem???
 
Hi

I worked on importing text files to tables a while back. Things that came to
mind are:

- Maximum number of fields in a table is 255. Type in the word
"specifications" under Access Help, you would find more information on
theorical limits of Access databases.

- Oftentimes, the text files contain data/records which would violate the
constraints defined for the table. For example, the text file may contain
duplicate values for a field that's defined as unique in the table. The text
file may not have values for fields defined as required in the table, etc.

- After import process, Access creates a table of paste errors. So you may
want to check the existence of this table. It will help you identify the
problems during import.


Immanuel Sibero
 
Back
Top