Importing text

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.
 
D

Douglas J. Steele

Try making a copy of the file, giving it a .txt extension, and see whether
you can import that.
 
E

Ernst Guckel

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.
 
D

Douglas J. Steele

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top