Import Text File Problem

GregSmith

Registered User.
Local time
Today, 15:41
Joined
Feb 22, 2002
Messages
126
I have searched the forum over and cannot figure this one out.
I am trying to import "c:\test\server.txt"

Here is the cmd:
DoCmd.TransferText acImportDelim, , "tablename", "c:\test\server.txt", False

When I run it, it tells me field F1 does not exist in the destination table.

Here is what the txt file looks like:

162979,System,Rdr,ERROR,SHQSR01A,Fri Sep 20 14:49:43 2002,8003,None,The master browser has received a server announcement from the computer CL1270 that believes that it is the master browser for the domain on transport NetBT_CpqNF32. The master browser is stopping or an election is being forced.
162978,System,Rdr,ERROR,SHQSR01A,Fri Sep 20 14:49:13 2002,8003,None,The master browser has received a server announcement from the computer CL1757 that believes that it is the master browser for the domain on transport NetBT_CpqNF32. The master browser is stopping or an election is being forced.

Any clues on how to import a text file correctly?

Also when it asks for a specification type - what is this?
 
Last edited:
I ran into this once. I got around it by first importing the file (clicking ok all the way). The wizard then creates a table which hopefully is ok to import to the next time.

Allthough as I recall access and I never quite saw eye to eye on this matter.

An import specification is a setting you design to import the data just the way you want. You may chose a different field separator or a different type of field etc. I think it is an optional argument.

Fuga.
 
The error message I was getting needed a field called F1. The wizard creates fields called field1, field2, etc. I renamed my fieldsx to fx and it worked like a charm.

If I had real field names like field1, field2, field3 etc

How can I get the import to go to the correct fields? Do I need to change the format of my txt file to include the fields?

Does anyone have a sample txt file that they can print here?

I am using comma delim for my spacing.
 
Now I remember. That´s what I did too.:)

Then I actually used an append query.
How can I get the import to go to the correct fields? Do I need to change the format of my txt file to include the fields?

How do you mean? Do you mean to add a row at the top containing field names?

Fuga.
 

Users who are viewing this thread

Back
Top Bottom