help!!! ado + xml

Discussion in 'XML' started by Vincent Jones, Feb 2, 2004.

  1. 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"

    %>
     
    Vincent Jones, Feb 2, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nita
    Replies:
    1
    Views:
    896
    Saravana
    Nov 20, 2004
  2. ronaldlee

    Transfer ADO Code to ADO.NET

    ronaldlee, Dec 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    486
    Kevin Spencer
    Dec 17, 2004
  3. Replies:
    0
    Views:
    1,335
  4. brainless

    HELP - ADO --> XML --> HTML ?

    brainless, Oct 10, 2003, in forum: XML
    Replies:
    0
    Views:
    333
    brainless
    Oct 10, 2003
  5. Navin
    Replies:
    1
    Views:
    744
    Ken Schaefer
    Sep 9, 2003
Loading...

Share This Page