When importing an Xml file into Access using VBA, can you direct the data to a specific table?
When I perform the import it is creating a new table based on the Xml file. I would like to be able to direct it to the table I have previously named.
Any help would be greatly appreciated.
Private Sub Command0_Click()
Dim strFile As String 'Filename
Dim strFileList() As String 'File Array
Dim intFile As Integer 'File Number
Dim strPath As String ' Path to file folder
strPath = "C:\New OE Imports\"
strFile = Dir(strPath & "*.XML")
While strFile <> ""
'add files to the list
intFile = intFile + 1
ReDim Preserve strFileList(1 To intFile)
strFileList(intFile) = strFile
strFile = Dir()
Wend
'see if any files were found
If intFile = 0 Then
MsgBox "No files found"
Exit Sub
End If
'cycle through the list of files
For intFile = 1 To UBound(strFileList)
Application.ImportXML strPath & strFileList(intFile), 2
Next intFile
MsgBox "Import Completed
When I perform the import it is creating a new table based on the Xml file. I would like to be able to direct it to the table I have previously named.
Any help would be greatly appreciated.
Private Sub Command0_Click()
Dim strFile As String 'Filename
Dim strFileList() As String 'File Array
Dim intFile As Integer 'File Number
Dim strPath As String ' Path to file folder
strPath = "C:\New OE Imports\"
strFile = Dir(strPath & "*.XML")
While strFile <> ""
'add files to the list
intFile = intFile + 1
ReDim Preserve strFileList(1 To intFile)
strFileList(intFile) = strFile
strFile = Dir()
Wend
'see if any files were found
If intFile = 0 Then
MsgBox "No files found"
Exit Sub
End If
'cycle through the list of files
For intFile = 1 To UBound(strFileList)
Application.ImportXML strPath & strFileList(intFile), 2
Next intFile
MsgBox "Import Completed