Solved

importing non txt files

Posted on 2004-04-28
10
462 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

809 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