Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

cgrunenberg

o que ela executa???

Recommended Posts

Oi pessoal, eu nunca trabalhei com XML, e o barato tá dando erro justamente nele, queria saber detalhes da sintaxe que está com erro:

 

Linha de Erro: oCmd.Execute , , 1024

 

Erro:

Microsoft XML Extensions to SQL Server error '80040e21'

Streaming not supported over multiple column result

/panasonic/ctrl/PILHAS/_CATEGORIAS.asp, line 36

 

 

Código do arquivo: _Categorias.asp

<%Public Sub MenuCategorias()'* DECLARA VARIAVEIS LOCAISDim objXML Dim objXSLSet objXML = Server.CreateObject("MSXML2.DOMDocument")Set objXSL = Server.CreateObject("Microsoft.XMLDOM")'Turn off asyncronous file loading. objXSL.async = false'Load the XSL file.objXSL.load(server.MapPath("CATEGORIAS.xsl"))STP = "EXEC SPPN_EdicaoProdutos @ACAO = 'P'"Set RsProd = Server.CreateObject("ADODB.Recordset")RsProd.CursorLocation = 3Dim oCmd, sSQLsSQL = "<root><sql:query xmlns:sql='urn:schemas-microsoft-com:xml-sql'>" & _	   "EXEC SPPN_EdicaoProdutos @ACAO = 'P'</sql:query></root>"response.write ssqlSet oCmd = Server.CreateObject("ADODB.Command")oCmd.ActiveConnection = Application("Conn")oCmd.CommandText = sSQLoCmd.Dialect = "{5D531CB2-E6Ed-11D2-B252-00C04F681B71}"Set outStrm = CreateObject("ADODB.Stream")	  '   Create the output streamoutStrm.OpenoCmd.Properties("Output Stream") = outStrm oCmd.Execute , , 1024objXML.loadXML(Trim(outStrm.ReadText))Response.Write(objXML.transformNode(objXSL))Set oCmd = NothingSet objXML = NothingSet objXSL = NothingEnd Sub%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Isso é erro de ASP e não de XML.Acho que é porque o método execute deve pedir alguma instrução SQL como parâmetro.Vamos aguardar algum moderador mover pra ASP.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Oi, eu consegui resolver parte do problema... não está mais dando o erro... eu completei a procedure, que como já mencionei antes não conheço nada de xml, a fiz incompleta. Agora, não aparece nenhum erro na página, ela fica completa como senão houvessem dados a serem exibidos, devo reforçar que a procedure possui os resultados a serem exibidos. A estrutura dos arquivos é abrir a página com index.asp, que chama o arquivo categorias.asp, que por sua vez chama o arquivo categorias.xsl e a procedure.

 

Notei ainda que os dados trazidos da procedure na página estão incompletos, como se alguma tag estivesse aberta, exatamente assim:

 

</S1>

</P>

<P>

<CatCodigo>13</CatCodigo

><CatTipo>E</CatTipo>

<CatNome>Bateria Auditiva</CatNome>

<S1>

<S2>

<S3/>

</S2>

</S1>

</P>

<P>

<CatCodigo>12</CatCodigo>

<CatTipo>E</CatT

 

Segue abaixo os códigos dos arquivos categorias.xsl e categorias.asp (na ordem):

 

<?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0" 	xmlns:my		="http://schemas.microsoft.com/office/infopath/2003/myXSD/2003-10-28T20:37:16" 	xmlns:xhtml		="http://www.w3.org/1999/xhtml" 	xmlns:html		="http://www.w3.org/HTML/1998/html4"	xmlns:xsl		="http://www.w3.org/1999/XSL/Transform" 	xmlns:msxsl		="urn:schemas-microsoft-com:xslt" 	xmlns:xd		="http://schemas.microsoft.com/office/infopath/2003" 	xmlns:x			="urn:schemas-microsoft-com:office:excel" 	xmlns:xdExtension	="http://schemas.microsoft.com/office/infopath/2003/xslt/extension" 	xmlns:xdXDocument	="http://schemas.microsoft.com/office/infopath/2003/xslt/xDocument" 	xmlns:xdSolution	="http://schemas.microsoft.com/office/infopath/2003/xslt/solution" 	xmlns:xdFormatting	="http://schemas.microsoft.com/office/infopath/2003/xslt/formatting" 	xmlns:xdImage		="http://schemas.microsoft.com/office/infopath/2003/xslt/xImage">	<xsl:output   method="xml"   indent="yes"   encoding="ISO-8859-1"	omit-xml-declaration="no"/><!--INICIO--><xsl:template match="root">	<html>	<head><title>PANASONIC</title></head>	<body>		<style type="text/css">		.Cat0 {FONT-WEIGHT: bold; FONT-SIZE: 10px; COLOR: #828181; LINE-HEIGHT: 18px; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif}		.Cat1 {FONT-WEIGHT: bold; FONT-SIZE: 16px; COLOR: #6666FF; LINE-HEIGHT: 18px; FONT-FAMILY: Arial}		a:link   {color:#828181; line-height:18px; font-family:Verdana, Arial, Helvetica, sans-serif; text-decoration:none;}		a:active {color:#828181; line-height:18px; font-family:Verdana, Arial, Helvetica, sans-serif; text-decoration:none;}		a:visited{color:#828181; line-height:18px; font-family:Verdana, Arial, Helvetica, sans-serif; text-decoration:none;}		a:hover  {color:#828181; line-height:18px; font-family:Verdana, Arial, Helvetica, sans-serif; text-decoration:none;}		</style>		<script>			function Detalhar(nome){				//alert(nome)				var exists;				eval('exists = typeof ' + "sub_"+nome+"");				if (exists != 'undefined'){					div = eval("sub_"+nome+".style")					if (div.display == "none"){						div.display = "block"					} else {						div.display = "none"					}				}				document.cookie = "COD_SUBCATEGORIA=" + nome;			}		</script>		<table cellpadding="1" cellspacing="0" border="1">			<xsl:apply-templates select="/root/C"/>		</table>	</body>	</html></xsl:template><!-- Nível 0 --><xsl:template match="C">	<tr style="display:block">	<td>			<xsl:if test="S1/CatCodigo != ''">			<a>			<xsl:attribute name="href">#</xsl:attribute>			<xsl:attribute name="onClick">			<xsl:value-of select="concat('Detalhar(', CatCodigo/text(), ')')"/>			</xsl:attribute>			<font class="Cat1">+</font>			</a>			</xsl:if>	</td>	<td>	   <a>		<xsl:attribute name="href">		<xsl:value-of select="concat('Pilhas.asp?CatCodigo=', CatCodigo/text())"/>		</xsl:attribute>		<font class="Cat0"><xsl:value-of select="CatNome"/></font></a>	</td>	</tr>		<tr style="display:none">	<xsl:attribute name="id">	<xsl:value-of select="concat('sub_', CatCodigo/text())"/>	</xsl:attribute>	<td>	</td>	<td>		<table cellpadding="2" cellspacing="0" border="0">			<xsl:apply-templates select="S1"/>		</table>	</td>	</tr></xsl:template><!-- Nível 1 --><xsl:template match="S1">		<tr style="display:block">		<td>			<xsl:if test="S2/CatCodigo != ''">			<a>			<xsl:attribute name="href">#</xsl:attribute>			<xsl:attribute name="onClick">			<xsl:value-of select="concat('Detalhar(', CatCodigo/text(), ')')"/>			</xsl:attribute>			<font class="Cat1">+</font>			</a>			</xsl:if>		</td>		<td>			<a>			<xsl:attribute name="href">			<xsl:value-of select="concat('Pilhas.asp?CatCodigo=', CatCodigo/text())"/>			</xsl:attribute>			<font class="Cat0"><xsl:value-of select="CatNome"/></font></a>		</td>		</tr>		<tr style="display:none">		<xsl:attribute name="id">		<xsl:value-of select="concat('sub_', CatCodigo/text())"/>		</xsl:attribute>		<td>		</td>		<td>			<table cellpadding="2" cellspacing="0" border="0">				<xsl:apply-templates select="S2"/>			</table>		</td>		</tr></xsl:template><!-- Nível 2 --><xsl:template match="S2">		<tr style="display:block">		<td>			<xsl:if test="S3/CatCodigo != ''">			<a>			<xsl:attribute name="href">#</xsl:attribute>			<xsl:attribute name="onClick">			<xsl:value-of select="concat('Detalhar(', CatCodigo/text(), ')')"/>			</xsl:attribute>			<font class="Cat1">+</font>			</a>			</xsl:if>		</td>		<td>			<a>			<xsl:attribute name="href">			<xsl:value-of select="concat('Pilhas.asp?CatCodigo=', CatCodigo/text())"/>			</xsl:attribute>			<font class="Cat0"><xsl:value-of select="CatNome"/></font></a>		</td>		</tr>		<tr style="display:none">		<xsl:attribute name="id">		<xsl:value-of select="concat('sub_', CatCodigo/text())"/>		</xsl:attribute>		<td>		</td>		<td>			<table cellpadding="2" cellspacing="0" border="0">				<xsl:apply-templates select="S2"/>			</table>		</td>		</tr></xsl:template><xsl:template match="CatCodigo">	<!-- CatCodigo: <xsl:value-of select="text()"/> --></xsl:template><xsl:template match="CatTipo"><!-- <b><xsl:value-of select="text()"/></b> --></xsl:template></xsl:stylesheet>

<%Public Sub MenuCategorias()'* DECLARA VARIAVEIS LOCAISDim objXML Dim objXSLSet objXML = Server.CreateObject("MSXML2.DOMDocument")Set objXSL = Server.CreateObject("Microsoft.XMLDOM")'Turn off asyncronous file loading. objXSL.async = false'Load the XSL file.objXSL.load(server.MapPath("CATEGORIAS.xsl"))STP = "EXEC SPPN_EdicaoProdutos @ACAO = 'P'"Set RsProd = Server.CreateObject("ADODB.Recordset")RsProd.CursorLocation = 3Dim oCmd, sSQLsSQL = "<root><sql:query xmlns:sql='urn:schemas-microsoft-com:xml-sql'>" & _	   "EXEC SPPN_EdicaoProdutos @ACAO = 'P'</sql:query></root>"response.write ssqlSet oCmd = Server.CreateObject("ADODB.Command")oCmd.ActiveConnection = Application("Conn")oCmd.CommandText = sSQLoCmd.Dialect = "{5D531CB2-E6Ed-11D2-B252-00C04F681B71}"Set outStrm = CreateObject("ADODB.Stream")	  '   Create the output streamoutStrm.OpenoCmd.Properties("Output Stream") = outStrm oCmd.Execute , , 1024objXML.loadXML(Trim(outStrm.ReadText))Response.Write(objXML.transformNode(objXSL))Set oCmd = NothingSet objXML = NothingSet objXSL = NothingEnd Sub%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

só com os caras de ASP.Jà que ninguém moveu o tópico, posta um novo lá.

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.