Solved

How can I import a file with an unknown extension ?

Posted on 2011-09-07
12
295 Views
Last Modified: 2012-05-12
Hey guys,

How do I import a *.JUZ file which is simply a txt file ? And I would like to create a button to display the data on the form before the import. Thanks in advance for the help.


JUZ-file.jpg
0
Comment
Question by:Sheogorath
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
12 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36498222
can you change the file extension to  .txt and open the file in notepad?

if you can you can import the text file into an access table

File > get external file > import
select the file type .txt
select the file clikc ok
follow the import wizard

if you want ot do this using vba codes,
in the process of importing, click Advanced button from the Import wizard window and creatre an Import Specification
0
 

Author Comment

by:Sheogorath
ID: 36498263
Thanks for your response. Yes, I can. The image attached above shows how it looks. But I don't want to go through the same import process every time an import needs to be made.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36498277
<But I don't want to go through the same import process every time an import needs to be made. >

you can do this using vba codes
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36498280
what version of Access are you using ?
0
 

Author Comment

by:Sheogorath
ID: 36498485
I am using Access 2007.
0
 

Author Comment

by:Sheogorath
ID: 36498506
I would like to use vba code but I need a sample :)
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36498519
upload a copy of the text file and a copy of your db..
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36498623
<And I would like to create a button to display the data on the form before the import.>
Then you have really two questions here.
1. Display an unknown text file in a form
2. Import the unknown file.

If "displaying" this file in a form is your first concern, then this will be difficult to do without this data first being imported into a table.
(So we have a bit of a Circular Logic scenario here.)
It would probably be most straightforward/simple to just to open the file in notepad...

I'll let capricorn1 help you with the import...


0
 

Author Comment

by:Sheogorath
ID: 36498708
OK, Thank you. Here they are.
SAMPLE.txt
DatabasesSample.accdb
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36498745
explain  where the information from the text file will go (name of table, name of fields)
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 36498885
You need to create an Import Specification to do this automatically

To create the Import Specification
1) Click on external data> text file which then opens another window called "Get external data - Text file"
2) Use radio button to select "Import the source data into a new table in the current database"
3) specify the source of the file using the browse procedure then click OK
4) Choose radio button to select delimited format and then click next
5) this window allows you to choose delimiter and text qualifier and if first row contains names - click next
6) This window allows you to type the name of the field in the Field Name column, choose data type, and if you want field indexed - also can choose to skip field - then click next
7) This window allows you to add primary key or designate field as such - click next

8) Click on ADVANCED button

9. in the import specification window
type the name of the field in the Field Name column
(here you can use the field names of the destination table, specify data type,
check the box Skip if you do not want to import the column)


10 click save as, give the specification a name <-- this is the specification name that you will use in the command line below


DoCmd.TransferText acImportFixed, "ImportSpecificationName", "NameOfTable", "C:\Sample.txt", False

0
 

Author Comment

by:Sheogorath
ID: 36511520
Thank you. I still would like to convert .JUZ to .txt with the button but i guess that would be a new question.
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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

691 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