help!!! ado + xml

V

Vincent Jones

Error Type:
ADODB.Command (0x800A0CB3)
Object or provider is not capable of performing requested operation.


<%@ LANGUAGE="VBSCRIPT" %>
<%
Dim conDB, cmdXML
Set conDB = CreateObject("ADODB.Connection")

With conDB
.Provider = "SQLOLEDB"
.ConnectionString = "Data Source=(local);" & _
"INITIAL CATALOG=Northwind;" & _
"INTEGRATED SECURITY=SSPI;"
.Open
End With

Set cmdXML = CreateObject("ADODB.Command")
Set cmdXML.ActiveConnection = conDB

Dim strQry
strQry = "<Invoice xmlns:sql='urn:schemas-microsoft-com:xml-sql'>"
strQry = strQry & "<sql:query>"
strQry = strQry & "Select OrderId, OrderDate From Orders "
strQry = strQry & "Where OrderId = 10248 FOR XML AUTO"
strQry = strQry &"</sql:query></Invoice>"

cmdXML.Dialect = "{5D531CB2-E6ED-11D2-B252-00C04F681B71}"
cmdXML.CommandText = strQry

Dim stmXMLout
Set stmXMLout = CreateObject("Adodb.Stream")
stmXMLout.Open
cmdXML.Properties("Output Stream") = stmXMLout
cmdXML.Execute, , adExecuteStream

Dim strXML
strXML = Replace(stmXMLout.ReadText, ">", ">" & Chr(10) + Char(13))
msgbox strXML, vbInformation, "XML Invoice"

%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top