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

Import automatically into Access 1

Status
Not open for further replies.

asiandoll

Programmer
Apr 24, 2002
19
0
0
BB
Hi All,

I have a problem, my company have this batch system, the data from this system is downloaded everyday and its in comma delimited file for excel... Is there a way that I can import it to a specific table in Access.... and I don't need all the data I need every other column in the excel file...

Thanx.. Any help is appreciated...
 
Have you tried impoorting the data manually, choosing every other column, and then saving the import spec?
Then in code you can call the transferText/Spreadsheet, and specify the import spec that u have saved. Hope this is ok. If not, just let me know.

Nick (Everton Rool OK!)
 
Um, I don't really wanna do that.. I am not gonna be doing so I need a code that actually just does the stuff off the bat for me.. (If you know what I mean?) :-D

Any help is appreciated.. Thanx...
 
Manually import the file 1 time. In the process, save the Import Specifications. Import into a new table (let's call it tblNew).

Now create an append query that takes the fields you want from tblNew, and inserts them into your other table.

Then delete tblNew.

Once you have saved the import spec, everything can be run from the click of a button (replace the red accordingly, yourfilename may be c:/My Documents/Myfile.txt or something similar):

======================
Private Sub YourButton_Click()
DoCmd.TransferText acImportDelim, "YourSpecNameHere", "tblNew", "YourFileNameHere"
DoCmd.OpenQuery "YourAppendQueryName"
DoCmd.DeleteObject acTable, "tblNew"
End Sub
======================
Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top