感谢您的提示,以下是我所做的...
Dim db As Database
Set db = CurrentDb()
Dim xDoc As MSXML.DOMDocument
Set xDoc = New MSXML.DOMDocument
Dim xNote As IXMLDOMNode
Dim x As IXMLDOMNodeList
Dim XMLpath, sSQL As String
XMLpath = Me.Text1
xDoc.validateOnParse = False
sSQL = "INSERT INTO Temp VALUES ('"
If xDoc.Load(XMLpath) Then
Set x = xDoc.getElementsByTagName("_TargetTag")
Else
MsgBox "XML file ERROR"
Exit Sub
End If
For j = 0 To x.length - 1
For i = 0 To lengthOfChildNode
sSQL = sSQL & x(j).childNodes(i).nodeTypedValue & "','"
Next i
sSQL = Left(sSQL, Len(sSQL) - 2) & ");"
db.Execute sSQL
sSQL = "INSERT INTO Temp VALUES ('"
Next j
到目前为止,我得到了我需要的东西,但是任何可以改进此代码的想法我都会非常感激。谢谢!