Importing text

  • Thread starter Thread starter Ernst Guckel
  • Start date Start date
E

Ernst Guckel

Hello,

I am having a bit of trouble importing data from a file. I have setup a
table that represents the data to be imported and am using the following code:

Function ImportData()

Dim strFile As String
Dim strStoreNumber As String
Dim dSalesDate As String
Dim strPath As String

strStoreNumber = GetOption("StoreNumber")
dSalesDate = Format("01/01/08", STRING_IMPORTDATE)
strPath = strStoreNumber & "_" & dSalesDate

strFile = STR_IMPORTPATH & "\" & strPath & "\" & STR_FILESALESDATA

DoCmd.TransferText acImportDelim, , "tblTemp", strFile
End Function

Here is the first line of the datafile:

0664
,01/01/08,0015,00000000,00000000,0000,0000,00000000,00000000,0000,0000,00000000,00000000,0000,0000,

the next line is the same.. there are I believe 96 lines...

I get the error

Runtime error 31519
Cannot import this file

the filename is Works020.cdf

Any help would be great...

Ernst.
 
Try making a copy of the file, giving it a .txt extension, and see whether
you can import that.
 
Works great now... Go figure :)

Ernst.


Douglas J. Steele said:
Try making a copy of the file, giving it a .txt extension, and see whether
you can import that.
 
Back
Top