title: XML output parameters with ADODB in ASP Classic
body: <p>I found this error looking for a solution to a problem of retrieving XML at ASP classic:
  <a href="https://stackoverflow.com/questions/19099334/declaring-xml-output-parameters-with-adodb-in-asp-classic">Declaring XML output parameters with ADODB in ASP Classic</a></p>
  
  <p>I have the same error working with Classic ASP and SQL Server 2003. I used to work with a .dll in VB6, where I could get the XML code. But now I need to do it from SQL direct to ASP.
  Did you manage to solve it?</p>
  
  <p>My code in classic ASP so far is:</p>
  
  <pre class="lang-vb prettyprint-override"><code>set objCommandoOP = Server.CreateObject("ADODB.Command")
  Set objCommandoOP.ActiveConnection = objConexion
  objCommandoOP.CommandType = adcmdStoredProc
  objCommandoOP.CommandText="spProducesXML"
  set ParamEnt = objCommandoOP.CreateParameter("@CodOne", adInteger, adParamInput, 4, Entidad())
  objCommandoOP.Parameters.Append ParamEnt
  set ParamUser = objCommandoOP.CreateParameter("@CodTwo", adInteger, adParamInput, 4, Usuario())
  objCommandoOP.Parameters.Append ParamUser
  set ParamFrac = objCommandoOP.CreateParameter("@GroupType", adInteger, adParamInput, 4, Request("GrupoFrac"))
  objCommandoOP.Parameters.Append ParamFrac
  set ParamReturn = objCommandoOP.CreateParameter("@paramReturn", adXML, adParamInputOutput, 4, 0)
  
  objCommandoOP.Parameters.Append ParamReturn
  
  set objResultseto = Server.CreateObject("ADODB.RecordSet")
  'Internal procedure that execute the ddbb sp
  ExecProcedure objResultseto, adOpenStatic, objCommandoOP
  
  sResult = "&lt;dmo:OperationImport xmlns:dmo='http://www.example.es/XML' xmlns:xs='http://www.w3.org/2001/XMLSchema' /&gt;"
  sResult = sResult &amp; ParamReturn
  sResultXML= sResultXML &amp; "&lt;/dmo:OperationImport&gt;"
  </code></pre>
  
  <p>The error happens at the "adXML" line, since as David I cannot find a XML variable to bring the parameter from the ddbb. I try to take it as paramReturn of the SQL procedure (with FOR XML EXPLICIT), any other ideas?</p>