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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading a .txt. file into Access

Status
Not open for further replies.

Sjackson330

Programmer
Nov 16, 2004
2
US
Here's my situation. I have a .txt file that I need to bring into Access. This .txt file is set up with records that are separated by semicolons.

I need to pull this information into Access and separate the data by the semicolons. I can open the file in Excel and separate the information by using Data --> Text to Columns --> semicolon (as the separator).

Does anyone have an idea how I can do this into Access.
 
What about the Access import wizard ?
menu File -> External data -> Import ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I was trying to do that all day, but whenever I select "import" nothing happens. I've had problems with Access 2000 in the past (because I have Access 2000 and Access 97 on the same machine). I went over to Access 97 and tried it (after I got your post), and everything worked fine. I still have to find a way to get Access 2000 to do the same thing. If you have any thoughts on that, please let me know.

 
The Import Wizard should work with the txt file. If not, you could always use Excel to import the txt file, save as xls file, then import the Excel file into Access. It's a workaround.
 
I am not really an Access person, but periodically have to use Access 97 for a client. I had to work with a text file recently and used the import wizard successfully, but am wondering if there is a programmatic method to do the same thing (for future reference). Basically, it opens the file and would parse through the file based on either column positioning and/or some sort of delimiter.

Any ideas on how to get this started.

Thanks!
 
Take a look at the DoCmd.TransferText method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top