R
rogge
Please help with 'false' field name being found in text file...
I am trying to import a text file into access using TransferText and
schema.ini:
DoCmd.TransferText acImportDelim, , tableName, filePath & fileName
the table is linked to a table with the same name in a back-end data base,
in a different folder,
with same name. The text files lie in a different folder. The table names
are the same as is the
text file, with the exception of the extension.
I get a Run-time error '2391':
Field 'F1' doesn't exit in destination table 'Account_Specific.'
So I searched through the file, Account_Specific.csv. I could not find the
string 'F1' or Like
"*F1*". Notepad could not find the string; Excel could not find the string.
I tried appending the 'HasFieldNames' option. but that also resulted in errors
False: exact same error
true: can't find a different field: 'Process Name_CUST CPM_Cond.....'
This happens to be the first line in the text file
I have tried changing some of the settings in the schema.ini file, but no
luck, and yes, this file
is in the same folder as the text file.... Code runs before
DoCmd.TransferText that makes sure that
the data structure of the text file and the table are congruent. the table's
field names are
examined against the first line in the text file. Then the table name and
file name are placed in
an array. A procedure is called, passing these names, to create the
schema.ini file. (to be sure
the correct info is passed, i checked with MsgBox.)
schema.ini is created on the fly, just before DoCmd.TransferText is run
[Account_Specific.csv]
Format=TabDelimited
ColNameHeader=True
MaxScanRows=0
CharacterSet=OEM
DecimalSymbol=.
NumberDigits=0
CurrencySymbol=$
CurrencyPosFormat=$1
CurrencyDigits=0
CurrencyThousandSymbol=,
CurrencyDecimalSymbol=.
Front-end.mdb
<text file folder>
schema.ini
Account_Specific.csv
file1.csv
file2.csv
<data folder>
back-end.mdb
I am trying to import a text file into access using TransferText and
schema.ini:
DoCmd.TransferText acImportDelim, , tableName, filePath & fileName
the table is linked to a table with the same name in a back-end data base,
in a different folder,
with same name. The text files lie in a different folder. The table names
are the same as is the
text file, with the exception of the extension.
I get a Run-time error '2391':
Field 'F1' doesn't exit in destination table 'Account_Specific.'
So I searched through the file, Account_Specific.csv. I could not find the
string 'F1' or Like
"*F1*". Notepad could not find the string; Excel could not find the string.
I tried appending the 'HasFieldNames' option. but that also resulted in errors
False: exact same error
true: can't find a different field: 'Process Name_CUST CPM_Cond.....'
This happens to be the first line in the text file
I have tried changing some of the settings in the schema.ini file, but no
luck, and yes, this file
is in the same folder as the text file.... Code runs before
DoCmd.TransferText that makes sure that
the data structure of the text file and the table are congruent. the table's
field names are
examined against the first line in the text file. Then the table name and
file name are placed in
an array. A procedure is called, passing these names, to create the
schema.ini file. (to be sure
the correct info is passed, i checked with MsgBox.)
schema.ini is created on the fly, just before DoCmd.TransferText is run
[Account_Specific.csv]
Format=TabDelimited
ColNameHeader=True
MaxScanRows=0
CharacterSet=OEM
DecimalSymbol=.
NumberDigits=0
CurrencySymbol=$
CurrencyPosFormat=$1
CurrencyDigits=0
CurrencyThousandSymbol=,
CurrencyDecimalSymbol=.
Front-end.mdb
<text file folder>
schema.ini
Account_Specific.csv
file1.csv
file2.csv
<data folder>
back-end.mdb