Import Text File with Import Spec

  • Thread starter Thread starter dball
  • Start date Start date
D

dball

I have a large fixed width txt file with a lot of fields. I have the file
layout as an excel worksheet. The file does not have field names.

I want to be able to create the table using the layout excel spreadsheet.

I can't figure out how to turn the spreadsheet into an import spec.

Please help.

Thanks
Dave
 
I have a large fixed width txt file with a lot of fields.  I have the file
layout as an excel worksheet.  The file does not have field names.

I want to be able to create the table using the layout excel spreadsheet.

I can't figure out how to turn the spreadsheet into an import spec.

Please help.

Thanks
Dave

You want to create a table from a text file with no field names? Bad
plan, IMHO. Create the table, then use an import specification to put
the data into the appropriate columns...

Public Sub ImportFixedWidth(ByVal strFile As String)

DoCmd.TransferText acImportFixed, "ImportSpecName",
"DestinationTable", strFileName, False
End Sub
 
no, I want to use the layout to create the table structure and then import
the data. I take it was you suggest is how to do the above.

I will try it and see if I can figure it out.

Thanks
 
no, I want to use the layout to create the table structure and then import
the data.  I take it was you suggest is how to do the above.  

I will try it and see if I can figure it out.

Thanks

The problem with creating the table structure on the fly is that you
can't reuse queries etc, because your structures will change. That's
why I didn't think it was a great idea... just seems like a lot more
work than necessary.
 
Back
Top