XML import Access XP

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

Guest

Hello,

I have approximately 3,000 .xml files to import into Access XP.

At the moment Access only allows me to import one file at a time. This will take some time to do the import in this manner. Is there some other way I can import this data into Access. I was looking to select all by using control select. It does not work.

Any help would be appreciated.
 
You should write code similar to this:

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


--
Joe Fallon
Access MVP



Kenny G said:
Hello,

I have approximately 3,000 .xml files to import into Access XP.

At the moment Access only allows me to import one file at a time. This
will take some time to do the import in this manner. Is there some other
way I can import this data into Access. I was looking to select all by
using control select. It does not work.
 
Joe,

Many thanks for your assistance. I'll use this code as is required. Looks like XML is here to stay and it's something I need to learn.

Kenny G
 
Back
Top