makman111
asked on
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 .Connectio n")
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.Clos e
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
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
Set oCmd = Server.CreateObject("ADODB
Set objDB = Server.CreateObject("ADODB
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'
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.Clos
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
ASKER
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=;datab ase=msspor tal;"
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;
ASKER
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 .Connectio n")
objDB.Open "provider=SQLOLEDB;uid=sa; pwd=;datab ase=msspor tal;"
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
%>
Code reads
<%
Dim oStream, oCmd
Set oStream = Server.CreateObject("ADODB
Set oCmd = Server.CreateObject("ADODB
Set objDB = Server.CreateObject("ADODB
objDB.Open "provider=SQLOLEDB;uid=sa;
szProc = "get_HostHistory_XML 1, 1, 'ATL01SSA21FSA01'"
'objRS.Open "exec get_HostHistory_XML 1, 1, 'ATL01SSA21FSA01'", objDB
'SqlStmt = "SELECT * FROM HostHistory WHERE NodeName='ATL01SSA21FSA01'
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
%>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Tyr ot check this link might help...
http://www.adopenstatic.com/faq/800a0cc1.asp