Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing Data

Status
Not open for further replies.

ejiro

Programmer
Aug 1, 2003
17
US
I am trying to automatically grab data from a *.txt file generated from a machine. What is the best way to do this in access.
 
If the text is formatted as a fixed-width or comma-delimited table, you can
1. Link it with File|Get External Data|Link
2. Import it with File|Get External Data|Import
3. Link or import it with DoCmd.TransferText

Regardless of what format it is in, you can use VBA file I/O statements to process it.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
How can I import data from a *.dxx file?
 
I have no idea what a .dxx file might be. But the file extension doesn't matter anyway. What matters is the file format. The extension often implies the file format, but not necessarily. So if your .dxx file is text in a fixed-width or comma-delimited format, you can do the same things you can do with a .txt file.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Adding one thing to Rick's response - if the file extension is not a standard one for text files, Access 2000 and above won't let you import/link it unless you edit your registry settings or change the file extension first.


John
 
John, are you sure of that? I believe all you have to do is type the file extension into the standard open dialog when selecting the file. For instance, ejiro could type *.dxx into the File Name text box and then select from among the .dxx files in the folder.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
I helped a customer with this problem a while back and it is documented at Microsoft's KB for Access 2000 and above.

You can specify any file name when importing "text" but will get an error if the file extension is not in the registry.

John
 
Jonfer,

You are right Access 2000 will not let you link/import this file extension. How do I go about editing the registry settings so that it will allow me to link to the file extension?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top