Import Text Schema Issue (1 Viewer)

Privateer

Registered User.
Local time
Yesterday, 19:36
Joined
Aug 16, 2011
Messages
178
Hello all, first post here. I hate to trouble you with a text import problem, but this will save a lot of time if we can make it work. Let me also mention that I am aware of saving the spec files during a manual import, but the front end is being passed around and each person could create a different spec file or overwrite one that works.
I have code to create a schema.ini file and that works fine. The delimiter is a pipe. But the transfer text line says the file does not exist. The import and schema files are both in the same folder and I can't figure out what is wrong. As always any help is appreciated
Michael

Schema:
[Header.txt]
MaxScanRows = 5
ColNameHeader = False
CharacterSet = ANSI
Format = Delimited(|)
Col1 = Field1 Text
Col2 = HeadingID Text
Col3 = Field3 Text
Col4 = Created Text
Col5 = Creator Text
Col6 = Changed Text
Col7 = Changer Text
Col8 = Specification Text
Col9 = SpecType Text
Col10 = AtthorGroup Text
Col11 = Modified Text
Col12 = Modifier Text

Error on this line:
DoCmd.TransferText acImportDelim, Destination, TargetTable, TargetFile, False
Immediate window values:
? destination
D:\PersonalData\ConroMia\Documents\Databases\Extracts\Schema.ini

? targettable
tblHeader

? targetfile
D:\PersonalData\ConroMia\Documents\Databases\Extracts\Header.txt

? err.Description
The text file specification 'D:personalDataConroMiaDocumentsDatabasesExtractsSchema.ini' does not exist. You cannot import, export, or link using the specification.

 

Galaxiom

Super Moderator
Staff member
Local time
Today, 09:36
Joined
Jan 20, 2009
Messages
12,492
TransferText is saying the specification doesn't exist. Leave it out.
Schema.ini is not the Specification. It is simply picked up automatically using the name and location.
 

Privateer

Registered User.
Local time
Yesterday, 19:36
Joined
Aug 16, 2011
Messages
178
Thanks Galaxiom, that got me one step closer. Now the error (2498) is: "An expression you entered is the wrong data type for one of the arguments." I am certain all twelve fields are matched up as text, date, or long integer. Do you know of any examples of working delimited and fixed width because my source file looks like both. This should not be this hard.
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 09:36
Joined
Jan 20, 2009
Messages
12,492
It is complaining about the arguments to the TransferText function not matching the expected types. When you left out the Specification argument you still needed to leave the comma in place so that it is just an empty argument.
 

Users who are viewing this thread

Top Bottom