import multiple log files by date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I am trying to import multiple log files that are named
with the word web followed by the date e.g.
web20040205.log. Is there a way to import with access
using some sort of wild card web*.log but that somehow
appends all 7 log files to the same table. I hope I
explained this well enough.

Thanks in advance.
Andrew
 
How to Import all Files in a Folder:

Private Sub btnImportAllFiles_Click()
'procedure to import all files in a directory and delete them.
'assumes they are all the correct format for an ASCII delimited import.
Dim strfile As String

ChDir ("c:\MyFiles")
strfile = Dir("FileName*.*")
Do While Len(strfile) > 0
DoCmd.TransferText acImportDelim, "ImportSpecName", "AccessTableName",
"c:\MyFiles\" & strfile, True
'delete the file (consider moving it to an Archive folder instead.)
Kill "c:\MyFiles\" & strfile
strfile = Dir
Loop

End Sub
 
Back
Top