共用方式為


儲存到 XML DOM 物件

您可以將 XML 格式的 Recordset 儲存至 MSXML DOM 物件的執行個體,如下列 Visual Basic 程式碼所示:

Dim xDOM As New MSXML.DOMDocument  
Dim rsXML As New ADODB.Recordset  
Dim sSQL As String, sConn As String  
  
sSQL = "SELECT customerid, companyname, contactname FROM customers"  
sConn="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Program Files" & _  
        "\Common Files\System\msadc\samples\NWind.mdb"  
rsXML.Open sSQL, sConn  
rsXML.Save xDOM, adPersistADO   'Save Recordset directly into a DOM tree.  
...  

另請參閱

以 XML 格式保存記錄