• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 493
  • Last Modified:

importing non txt files

hello

I have *.unl files.
I want to import them lile txt files. how can I do?
0
yesilkalem
Asked:
yesilkalem
  • 5
  • 4
1 Solution
 
rockiroadsCommented:
what is a unl file, is it txt format?

why not rename it?

e.g.

dim sOldFile as String
dim sNewFile as string

sOldFile = "test1.unl"
sNewFile = Replace(sOldFIle,".unl",".txt")

DoCmd.TransferText acImportDelim,,"tablename",sNewFile

if it is delimited, if fixed then you use acImportFixed
0
 
flavoCommented:
Short answer, dont really really think you can.. here;s a work around

sub import()

Name "c:\something.unl" as "c:\something.txt"

Docmd.TransferText acImportFixed, "mySpec", "tblMyTable", "c:\something.txt"


Name "c:\something.txt"  as "c:\something.unl"

Dave
0
 
flavoCommented:
To quick rocki!
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
rockiroadsCommented:
Hi Dave, hows it going
0
 
flavoCommented:
Got an exam tomorrow, should be studying.. This place is too adictive....
0
 
rockiroadsCommented:
tell me about it, im being in my work
deadline is friday, Ive got heaps to do!
0
 
flavoCommented:
Ive gotta go.. really need to do at least a little..

Cheers!
0
 
rockiroadsCommented:
good luck with exam!!!
0
 
yesilkalemAuthor Commented:
thank you flavo
0
 
rockiroadsCommented:
actually I forgot one line, but dont worry about it, looks like u got it sorted

after sNewFile = Replace(sOldFIle,".unl",".txt")
you do FileCopy sOldFile, sNewFile


0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now