Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data import from TXT file into a table will not work

Status
Not open for further replies.

fdv

Technical User
Sep 18, 2007
3
US
This happens with BOTH MS Access 2000 and 2003.
Since pictures are best, here is what is happening:

I have a table that matches the fields in a text file I am importing ("has field names" in TransferText is YES).

The import gives an error saying that the table field names don't say "Field1" (huh? Why would I want them to?) and only imports 2 fields of about 20.

So I change the table's names to Field1, Field2, etc.

I run the Macro again.

I get an "unable to append the data" error. Same result: only 2 fields are filled.
 




Hi,

Does the file spec-semicolon have the correct field names?

Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
No, I created the spec-semicolon weeks earlier using the export function looong before I made this table and macro.

So I did not put field names into it. In fact I have no idea how to put field names into a spec! I thought a spec was simply a specification of what to use as a delimiter, nothing more.

How do I edit the fields in a spec? I am Googling but only see Access 2007 results. (I need 2000 or 2003)

Thanks
 
The easiest way to create a new spec is to export the table and save the spec, you can then use it to import the text file.
 
*smacks self on forehead*
Dude, I wish I had had you sitting next to me instead of wasting two weeks on this ;-)

It worked.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top