How to import textfile

timpepu

Registered User.
Local time
Today, 13:27
Joined
Nov 6, 2009
Messages
22
Hi ! How to import textfile named examble 123.dat to the access sheet ,I have tried with access ready macro import tex but it doesn't allow import file named .dat ?

Bs Timo
 
What does the contents on the dat file look like? can you provide a sample?

Dat files usually require customisation due to the vertical layout.

David
 
What does the contents on the dat file look like? can you provide a sample?

Dat files usually require customisation due to the vertical layout.

David

It is normal texfile like this :

000000020070;ZER ;20091106;20091106;R;1007;Heinola
 
i've not tried, but can you use

docmd.transfertext to select a file with a non-standard extension, and import it that way.

if you need a specification, change the extension to .txt or ,csv, then use the wizard, just to get the spec working

obviously you can change the separator character to suit, in the spec file
 
i've not tried, but can you use

docmd.transfertext to select a file with a non-standard extension, and import it that way.

if you need a specification, change the extension to .txt or ,csv, then use the wizard, just to get the spec working

obviously you can change the separator character to suit, in the spec file

I tried this but I get on error, file cant import ?

Function Makro1()
On Error GoTo Makro1_Err
DoCmd.TransferText acImportDelim, "", "taulukko", "F338H0EF.dat", False, ""

Makro1_Exit:
Exit Function
Makro1_Err:
MsgBox Error$
Resume Makro1_Exit
End Function
 
Have you tried to do it manually via File Import?
 
then change the extension and see whether that fixes it

note you can do this programatically at run time ("name command")

Name old file newfile (aircode - might be the other way round)
 
then change the extension and see whether that fixes it

note you can do this programatically at run time ("name command")

Name old file newfile (aircode - might be the other way round)

If I name the file .txt it work ,how I can change file named .dat to name .txt using VBA
 
i've just said

the NAME command

NAME oldfile newfile (or maybe the other way round - check help)
 

Users who are viewing this thread

Back
Top Bottom