• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 21. XML Support in Microsoft Access > Using ADO Code to Work with XML

Using ADO Code to Work with XML

As an alternative, you can use ADO code to work with an XML document. The code that follows provides an example.

Public Sub ExportXMLADO(strTableName as String, strFileName as String)

    Dim rst As ADODB.Recordset

    On Error GoTo ExportXMLADO_Err

    Set rst = New ADODB.Recordset
    rst.Open strTableName, CurrentProject.Connection
    rst.Save CurrentProject.Path & "\" & strFileName, adPersistXML
    rst.Close

    Set rst = Nothing

ExportXMLADO_Exit:
    Exit Sub

ExportXMLADO_Err:
    MsgBox Err.Number & ": " & Err.Description
    Resume ExportXMLADO_Exit
End Sub


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint