This method create standard format XML from an ADO recordset. The XML format is identical to that of CursorToXML.
o.ADOtoXML(loRS, lcName, lcRowName, lnIndent, llNoHeader)
An ADO Recordset
Optional - element name used at the table level. Note this tag sits underneath the document root. (wwBanners in the example).
Default value: The name of the current Alias().
Optional - The element name used for each row of the cursor.
Default value: "row"
Optional - Indentation level to start with.
Optional - Leave out the XML Header
ADO types are first converted to VFP types when creating data structure information, thus translations from specialized SQL types may not be exact.
Note that this format is not ADO compatible XML. You cannot do rs.open(,1) on this data. If you need that format simply use rs.Save(filename,1) - it'll be much faster. This XML format has the advantage of being standard format that's easy to parse and read.
ADO parsing can be slow due to ADO COM overhead. Compared to parsing VFP data into XML you'll see 2-3 times slower performance.
oXML = CREATEOBJECT('wwXML') oAdo = CREATEOBJECT("adodb.connection") oAdo.Open("dsn=Pubs;uid=sa") rs = oADO.Execute("select * from authors") lcXML = oXML.AdoToXML(rs) ShowXML(lcXML)
See also:Class wwXML (High Level Methods) | wwXML::CursorToXML
Comment or report problem with topic