• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 500
  • Last Modified:

Errors Streaming XML with ADO 2.7 (500 pts)

I keep getting the following error when I am using XML and ADO Streaming (2.7)  Any sugestions?

ADODB.Command error '800a0cc1'

Item cannot be found in the collection corresponding to the requested name or ordinal.

/test4.asp, line 19


My code looks like

     Dim oStream, oCmd
     Set oStream = Server.CreateObject("ADODB.Stream")
     Set oCmd = Server.CreateObject("ADODB.Command")
     Set objDB = Server.CreateObject("ADODB.Connection")
     
     objDB.Open Session("MyDSN")

     szProc = "get_HostHistory_XML  1, 1, 'ATL01SSA21FSA01'"
     'objRS.Open "exec get_HostHistory_XML  1, 1, 'ATL01SSA21FSA01'", objDB
     'SqlStmt = "SELECT * FROM HostHistory WHERE NodeName='ATL01SSA21FSA01' FOR XML AUTO"
         
     oStream.CharSet = "windows-1252"
     ' function which returns ADODB.Connection Object that is
     ' opened successfully
     oStream.Open
     Set oCmd.ActiveConnection = objDB
     oCmd.CommandText = "get_HostHistory_XML  1, 1, 'ATL01SSA21FSA01'"
     oCmd.Properties("Output Stream").Value = oStream
     oCmd.Properties("XML Root") = "root"
     oCmd.Properties("Output Encoding") = "iso-8859-1"
     oCmd.Execute , , 1024
     oCmd.ActiveConnection.Close
     oStream.Position = 0

     GetData = oStream.ReadText()
     oStream.Close
     
     Response.Expires = -1500
     Response.CacheControl = "no-cache"
     Response.ContentType = "text/xml"

     Response.Write(GetData)
         
     objDB.Close
     Set oCmd = Nothing
     Set oStream = Nothing
0
makman111
Asked:
makman111
  • 2
  • 2
1 Solution
 
gladxmlCommented:
makman111,

Tyr ot check this link might help...

http://www.adopenstatic.com/faq/800a0cc1.asp
0
 
makman111Author Commented:
Nope - not it.  I modifyied the code and now I am getting the following

Microsoft XML Extensions to SQL Server error '80040e14'

MSXML3: Invalid at the top level of the document.

/test4.asp, line 22


I changed the connection string to

objDB.Open "provider=SQLOLEDB;uid=sa;pwd=;database=mssportal;"
0
 
makman111Author Commented:
Figured it out...

Code reads

<%
     Dim oStream, oCmd
     Set oStream = Server.CreateObject("ADODB.Stream")
     Set oCmd = Server.CreateObject("ADODB.Command")
     Set objDB = Server.CreateObject("ADODB.Connection")
     
     objDB.Open "provider=SQLOLEDB;uid=sa;pwd=;database=mssportal;"
     szProc = "get_HostHistory_XML  1, 1, 'ATL01SSA21FSA01'"
     'objRS.Open "exec get_HostHistory_XML  1, 1, 'ATL01SSA21FSA01'", objDB
     'SqlStmt = "SELECT * FROM HostHistory WHERE NodeName='ATL01SSA21FSA01' FOR XML AUTO"
         
     oStream.CharSet = "windows-1252"
     ' function which returns ADODB.Connection Object that is
     ' opened successfully
     oStream.Open
     Set oCmd.ActiveConnection = objDB
     oCmd.CommandText = "get_HostHistory_XML  1, 1, 'ATL01SSA21FSA01'"
     oCmd.Properties("XML Root") = "root"
     oCmd.Properties("Output Encoding") = "iso-8859-1"
     oCmd.Properties("Output Stream") = oStream
     oCmd.Execute , , 1024
     oStream.Position = 0

     GetData = oStream.ReadText()
     oStream.Close
     
     Response.Expires = -1500
     Response.CacheControl = "no-cache"
     Response.ContentType = "text/xml"

     Response.Write(GetData)
         
     objDB.Close
     Set oCmd = Nothing
     Set oStream = Nothing

%>
0
 
gladxmlCommented:
makman111,

Try to check this link  

http://www.adopenstatic.com/faq/80040e14.asp
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now