Problem importing *.txt files

martell

Registered User.
Local time
Today, 10:03
Joined
Dec 27, 2007
Messages
10
dear all,

i have a problem when i want to importing *.txt files into a new table..i have the *.txt's file format like the attachment. the question is, i want the result in the table,between field NO until field amount in one record my table fields is |No|PLU|Desc|QTY |FRAC |Prcs|POT1|POT2|Tax1|tax2|KMS|Amount|

but i have the probelm when i finished the importing the file the result become unstructural..anyone can help me?


regards
 

Attachments

dear bob larsson

Dim rst As ADODB.Recordset
Dim strFile As String
Dim strInput As String
Dim varSplit As Variant
Dim intCount As Integer

Set rst = New ADODB.Recordset
' CHANGE THE TABLE NAME HERE
rst.Open "TextImportTest", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
' CHANGE THE TEXT FILE NAME AND LOCATION HERE
strFile = "C:\Temp\D0980.txt"

Open strFile For Input As #1

there is a error said, " the file not found",why whis happened?

thanks

regards


martell
 
The only thing I can think of is that either the path or file name is not exactly right. But, since the file location and file is so simple (in other words, not too long) I'm sure you probably got it right. Just make sure to double check that the file is named with zeroes and not an O (oh) in there somehow by accident.
 
dear bob,

i'm already change the file name into abc.txt but the error message is still the same..any other way to solve my problem?thanks alot..u're so kind

regards

martell
 
I can't think of anything else. So you have the file abc.txt in the TEMP folder on your C drive?
 
dear bob,

yeap,i have abc.txt file in my c drive..but it still an error.

regards

martell
 
Not sure what to tell you, except to maybe try using a different folder or drive. I'm at a loss otherwise. I would probably have to actually sit at your computer to figure it out and we both know that isn't going to happen. Sorry I can't think of anything else at this point.
 

Users who are viewing this thread

Back
Top Bottom