?
Solved

Errors Streaming XML with ADO 2.7 (500 pts)

Posted on 2003-03-20
4
Medium Priority
?
497 Views
Last Modified: 2012-05-04
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
Comment
Question by:makman111
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 15

Expert Comment

by:gladxml
ID: 8178668
makman111,

Tyr ot check this link might help...

http://www.adopenstatic.com/faq/800a0cc1.asp
0
 

Author Comment

by:makman111
ID: 8178702
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
 

Author Comment

by:makman111
ID: 8178706
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
 
LVL 15

Accepted Solution

by:
gladxml earned 1000 total points
ID: 8178726
makman111,

Try to check this link  

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question