code_junkie

How can I automate exporting of tables into proper XML files from MSSQL or Access?

Nov 11th, 2011
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. SELECT
  2. *
  3. FROM
  4. Customers
  5. INNER JOIN Orders ON Orders.CustID = Customers.CustID
  6. FOR XML AUTO
  7.  
  8. <customer id="204">
  9. <firstname>John</firstname>
  10. <lastname>Public</lastname>
  11. </customer>
  12.  
  13. Const acExportTable = 0
  14.  
  15. Set objAccess = CreateObject("Access.Application")
  16. objAccess.OpenCurrentDatabase "C:ScriptsTest.mdb"
  17.  
  18. 'Export the table "Inventory" to test.xml
  19. objAccess.ExportXML acExportTable,"Inventory","c:scriptstest.xml"
Add Comment
Please, Sign In to add comment