Hi all,
I ran into problem with Importxml in Ac2003. I am writing a piece of code to import xml files to an Access database.
Here is my code:
I had been trying another piece of code which cycle through files in a folder using .FileSearch, but it just gave me error and didn't run properly. I decided to try another approach and feed the file names to the Application.Importxml line using DIR. It looks like the DIR part is doing what it's supposed to do, but the Importxml just give me an error saying the method is failed. I tried something similar on another machine, it didn't give error but it just doesn't do anything and skipped every files.
Anyone has any idea?
Please help, thanks!!
AC
I ran into problem with Importxml in Ac2003. I am writing a piece of code to import xml files to an Access database.
Here is my code:
Code:
Private Sub Command0_Click()
Dim myfile, mypath
mypath = "C:\Documents and Settings\X\My Documents\submission\TODAY\*.xml"
myfile = Dir(mypath)
Do Until myfile = ""
On Error GoTo errhandling1
Application.ImportXML DataSource:=myfile, ImportOptions:=acAppendData
myfile = Dir
Loop
MsgBox "Done!!", vbOKOnly
Exit Sub
errhandling1: MsgBox Error(Err)
End Sub
Anyone has any idea?
Please help, thanks!!
AC