Importing Multiple XML files into Access 2003

B

brianhlcl

I would like to import about 40 XML files all in the same folder with
the same structure into an Access table without having to import each
one individually. The file names of the XML files are all different,
and I have no control over that. Anyone know a way to do that?
 
P

pietlinden

I would like to import about 40 XML files all in the same folder with
the same structure into an Access table without having to import each
one individually. The file names of the XML files are all different,
and I have no control over that. Anyone know a way to do that?

something like this should work...

Private Sub Command0_Click()

Dim strFile As String
Dim strPath As String

strPath = BrowseFolder("Choose a directory...")

strFile = Dir(strPath & "\*.xml")
Do Until strFile = ""
strFile = Dir
'DoCmd.TransferText acImportDelim, "MySavedSpecName",
"DestinationTable", strFile, False
Application.ImportXML DataSource:=strFile, OtherFlags:=1
Loop


End Sub
Except you're going to use
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top