Error persisting XML stream to ADO recordset 
Author Message
 Error persisting XML stream to ADO recordset

The followoing error is received when loading an XML
stream to an ADO recordset.
Microsoft OLEDB Persistence Provider (0x80004005)
Recordset cannot be created. Source XML is incomplete or
invalid

ASP Code Snippet:

Dim xmlDoc
set xmldoc = CreateObject("MSXML2.DOMDocument")

xmldoc.loadxml "<root><child>test</child></root>"        
set oRs = CreateObject("ADODB.Recordset")
oRS.Open xmldoc

Response.Write oRs.Fields("child")

Set oRS = Nothing
Set xmlDoc = Nothing

The code snippet is similar to many found on MSDN.

Server: IIS 5.0
OS: Win2K
MDAC: 2.6

TIA,

Tim



Sat, 05 Mar 2005 01:29:13 GMT
 Error persisting XML stream to ADO recordset

Hi,

Problem here is that to be able to open ADO recordset based on XML
file/stream you would need to format your XML according to specification for
ADO XML recordsets. ADO allows to open XML files ONLY if they are formatted
according that specification and you cannot load any XML file/stream into
recordset. To see specification you would need to read "XML Integration
Features in ADO 2.5" article from MSDN. It was available on-line, but I do
not see it anymore. If you have MSDN installed on your PC, then you should
have it. If you do not find it, let me know and I will e-mail it to you

--
Val Mazur
Microsoft MVP


Quote:
> The followoing error is received when loading an XML
> stream to an ADO recordset.
> Microsoft OLEDB Persistence Provider (0x80004005)
> Recordset cannot be created. Source XML is incomplete or
> invalid

> ASP Code Snippet:

> Dim xmlDoc
> set xmldoc = CreateObject("MSXML2.DOMDocument")

> xmldoc.loadxml "<root><child>test</child></root>"
> set oRs = CreateObject("ADODB.Recordset")
> oRS.Open xmldoc

> Response.Write oRs.Fields("child")

> Set oRS = Nothing
> Set xmlDoc = Nothing

> The code snippet is similar to many found on MSDN.

> Server: IIS 5.0
> OS: Win2K
> MDAC: 2.6

> TIA,

> Tim



Sat, 05 Mar 2005 01:48:20 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Opening a recordset from a Persisted XML Stream Object (ADO 2.5)

2. Error Occurs Opening an ADO Recordset from an XML ADO Stream

3. ADO 2.5 persisting recordset as XML

4. Modifing structure for a persisted ADO - XML recordset

5. Help: ADO 2.5 XML works, ADTG doesn't with persisted recordsets

6. Persisting an ADO Recordset with XML in ASP

7. ADO 2.5 persisting a recordset as XML

8. Modifing structure for a persisted ADO - XML recordset

9. Persist recordset as XML, or cook XML w/ XMLDSO

10. Convert XML Stream to ADO Recordset

11. MTS/distributed recordsets (ADO XML streaming??)

12. ADO XML Stream Hierarch Recordset


 
Powered by phpBB® Forum Software