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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with Schema.ini and a field that isn't even there

Status
Not open for further replies.

spizotfl

MIS
Aug 17, 2005
345
US
Hi, I have been looking around and it seems like every few months someone has a problem working with a schema.ini file but I can't seem to resolve mine with the other information I've found to this point.
The problem that I am having is a keep getting the message: "Field 'F1' doesn't exist in destination table 'tblTest'." Which is quite true. I don't know where it is acquiring a fieldname of F1 from anywhere as I don't have one anywhere.

Here is my schema.ini
Code:
[Input.txt]
ColNameHeader=False
CharacterSet=ANSI
Format=Delimited(|)
MaxScanRows=0
Col1=Number1 Long
Col2=Number2 Long
Col3=Number3 Long
Col4=TextA Text
Col5=TextB Text
Col6=TextC Text
Col7=TextD Text
Col8=TextE Text

Here is my Input.txt file:
Code:
1|0|5|a|b|c|d|e
2|9|4|f|g|h|i|j

Here is my vba code
Code:
Private Sub btnImport_Click()
DoCmd.TransferText acImportDelim, , "tblTest", "C:\Documents and Settings\mblupton\My Documents\Test\Input.txt"
End Sub

The Input.txt and schema.ini are both in the same folder. I tried putting the column names in quotes, but that didn't change anything (and it looks like they aren't supposed to be quoted from the information I've seen, anyway).

As always, any help is appreciated. Many thanks.

"Maturity is a bitter disappointment for which no remedy exists, unless laughter can be said to remedy anything."
-Vonnegut
 
spizotfl

I have posted an different way to import a txt file using a schema.ini, in thread181-1085235.

After this line
cat.Tables.Refresh
put a breakpoint, goto the tables and check the linked table, which is the file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top