Solved

importing non txt files

Posted on 2004-04-28
10
476 Views
Last Modified: 2012-06-27
hello

I have *.unl files.
I want to import them lile txt files. how can I do?
0
Comment
Question by:yesilkalem
  • 5
  • 4
10 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 10936911
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
 
LVL 34

Expert Comment

by:flavo
ID: 10936913
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
 
LVL 34

Expert Comment

by:flavo
ID: 10936916
To quick rocki!
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 65

Expert Comment

by:rockiroads
ID: 10936919
Hi Dave, hows it going
0
 
LVL 34

Expert Comment

by:flavo
ID: 10936973
Got an exam tomorrow, should be studying.. This place is too adictive....
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 10937047
tell me about it, im being in my work
deadline is friday, Ive got heaps to do!
0
 
LVL 34

Expert Comment

by:flavo
ID: 10937062
Ive gotta go.. really need to do at least a little..

Cheers!
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 10937100
good luck with exam!!!
0
 

Author Comment

by:yesilkalem
ID: 10937270
thank you flavo
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 50 total points
ID: 10937392
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question