wwxml::ADOtoXML

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)

Return Value

Generated XML

Parameters

loRS
An ADO Recordset
lcName
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().

lcRowName
Optional - The element name used for each row of the cursor.
Default value: "row"

lnIndent
Optional - Indentation level to start with.

llNoHeader
Optional - Leave out the XML Header

Remarks

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.

Example

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

© West Wind Technologies, 1996-2018 • Updated: 10/21/99
Comment or report problem with topic