Solved

importing non txt files

Posted on 2004-04-28
10
438 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
Comment Utility
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
Comment Utility
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
Comment Utility
To quick rocki!
0
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
Hi Dave, hows it going
0
 
LVL 34

Expert Comment

by:flavo
Comment Utility
Got an exam tomorrow, should be studying.. This place is too adictive....
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 65

Expert Comment

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

Expert Comment

by:flavo
Comment Utility
Ive gotta go.. really need to do at least a little..

Cheers!
0
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
good luck with exam!!!
0
 

Author Comment

by:yesilkalem
Comment Utility
thank you flavo
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 50 total points
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now