I'm trying to retrieve an XML column from a table in a DB2 database. Using the code below, I can retrieve any column that does not have xml as the data-type:
query = "some query"
strConn = "my connection string"
set dbConn = CreateObject("ADODB.Connection")
set rs = CreateObject("ADODB.RecordSet")
dbConn.Open strConn
rs.Open query, dbConn
rs.MoveFirst
While Not rs.EOF
data = rs.Fields(0)
rs.MoveNext
Wend
dbConn.Close
When the data is an xml data-type, the line "data = rs.Fields(0)" throws an "unspecified error". I thought since the recordset returns an XML object, I need to assign it to a DOM object like this:
Set xDOM = CreateObject("Microsoft.XMLDOM")
rs.Save xDOM, adPersistXML
but this still doesn't work, QTP throws an "unspecified error" when executing the save line.
I googled for an answer but couldn't find anything that would help. Is there anyone out there who has successfully done this?
Thanks for reading my question.