XML import Access XP

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.
 
J

Joe Fallon

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.
 
G

Guest

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
 

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