Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Importing / Linking / December 2004

Tip: Looking for answers? Try searching our database.

How do I import more than one file at a time?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jeff - 10 Dec 2004 11:35 GMT
I want to create a new table by importing a tab-delimited text file. However,
I've got a lot of other text files, formatted the same way, which will also
need to be imported into the same table. How do I select more than one file
at a time to import?

Thanks
Jeff
Jeff Boyce - 10 Dec 2004 12:39 GMT
I'm not aware of a way to tell Access to import more than a single file at a
time.  That said, there'd be no reason you couldn't come up with a procedure
that ran through a list of files and imported them one-by-one.

Consider another approach, however.  If you import to a temporary table,
then append from that table into your permanent table, you can import any
number of files (sequentially, of course).

Good luck

Jeff Boyce
<Access MVP>

> I want to create a new table by importing a tab-delimited text file. However,
> I've got a lot of other text files, formatted the same way, which will also
[quoted text clipped - 3 lines]
> Thanks
> Jeff
Nikos Yannacopoulos - 10 Dec 2004 12:41 GMT
Jeff,

Assuming you have already done it oce manually, so you have saved an
import spec, you can do it at once for all files in a folder through
this simple piece of code:

Sub Import_Files_From_Folder()
Set fs = CreateObject("Scripting.FileSystemObject")
Set fldr = fs.GetFolder("C:\MyFolder\")
Set fls = fldr.Files
For Each fl In fls
    DoCmd.TransferText acImportDelim, _
    "MySpecificationName", "MyTable", fl.Path
Next fl
End Sub

Replace the folder, spec and table names with the actual ones, and off
you go.

HTH,
Nikos

> I want to create a new table by importing a tab-delimited text file. However,
> I've got a lot of other text files, formatted the same way, which will also
[quoted text clipped - 3 lines]
> Thanks
> Jeff
Nikos Yannacopoulos - 10 Dec 2004 14:37 GMT
Of no particular importance, just being "nostalgic":

Anybody remember the black, character mode DOS (as in Disk Operating
System, not Denial Of Service!) screens? Well, in one of those, one
could simply type:

Copy *.txt allfiles.txt

and DOS would copy the contents of all .txt (or whatever) files in the
folder in one file... then the import process would be a one step one!
Isn't it funny that some things were easier back then? Anybody tried to
mass-rename files in Windows?

Nikos

> Jeff,
>
[quoted text clipped - 25 lines]
>> Thanks
>> Jeff
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.