Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > help!!! ado + xml

Thread Tools

help!!! ado + xml

Vincent Jones
Posts: n/a
Error Type:
ADODB.Command (0x800A0CB3)
Object or provider is not capable of performing requested operation.

Dim conDB, cmdXML
Set conDB = CreateObject("ADODB.Connection")

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

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

Dim strQry
strQry = "<Invoice xmlns:sql='urn:schemas-microsoft-comml-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")
cmdXML.Properties("Output Stream") = stmXMLout
cmdXML.Execute, , adExecuteStream

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

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Translating Oracle Package Call from ADO to ADO.Net ASP .Net 0 02-14-2005 10:39 PM
Transfer ADO Code to ADO.NET ronaldlee ASP .Net 1 12-17-2004 04:08 PM
Accessing an ADO Recordset or Record from ADO.NET nita ASP .Net 1 11-20-2004 07:06 AM
Ado sort error-Ado Sort -Relate, Compute By, or Sort operations cannot be done on column(s) whose key length is unknown or exceeds 10 KB. Navin ASP General 1 09-09-2003 07:16 AM