A client generates data in an XML file and imports it successfully into Excel. The data that's needed is several columns in and several rows down.
It would be much easier to import directly into Access but the Wizard just creates a set of empty tables.
I tried creating an empty table in Import.accdb using just the needed column headers appearing in the Excel import, then ran this
Still no data. Have to say I'm not at all familiar with using XML.
It would be much easier to import directly into Access but the Wizard just creates a set of empty tables.
I tried creating an empty table in Import.accdb using just the needed column headers appearing in the Excel import, then ran this
Code:
Private Sub Command0_Click()
Dim objAccess As Object
[indent]Const acAppendData = 2
Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase "C:\temp\Import.accdb"
objAccess.ImportXML "c:\temp\drt.xml", acAppendData[/indent]
End Sub
Still no data. Have to say I'm not at all familiar with using XML.