.Parameters.Append .CreateParameter is not passing the second parameter

0

I have a system in ASP Classico, and I'm trying to execute a SQL Server procedure passing two parameters.

I originally passed only one selected date in a datepicker and it worked, now I want to pass an int value obtained in a combo (containing values 1, 2 and 3).

Values are being sent through the function when I click the button:

var data = document.getElementById("datepicker").value;
var homolog = document.getElementById("homolog").value;

Outros comandos...

xmlreq.open("GET", "carregahorarios.asp?data="+data + "&homolog=" + homolog, true);

The page carregahorarios.asp receives these values:

data = request.QueryString("data")
homolog = request.QueryString("homolog")

And creating the call to the procedure:

Set cmd = Server.CreateObject("adodb.command")
With cmd
   ' Set up DB connection to use, set the type of SQL command
   .ActiveConnection = conexao
   .CommandType = adCmdStoredProc
   .CommandText = "HorarioDisponivelHomolog"

   .Parameters.Append .CreateParameter("@dataselec", adDBTimeStamp, adParamInput, 0, datanew&" 00:00:00")
   .Parameters.Append .CreateParameter("@homolog", adInteger, adParamInput)

   set rs = .Execute
End With

The parameter that is giving problem is this @homolog.

When I click the button that calls the procedure it gives the following error message:

O procedimento ou a função 'HorarioDisponivelHomolog' espera o parâmetro '@homolog' que não foi fornecido.
    
asked by anonymous 10.09.2015 / 15:46

1 answer

0

Include the field homolog as a value at the end of the line, along with the

.Parameters.Append .CreateParameter("@homolog", adInteger, adParamInput, 1 homolog)
    
10.09.2015 / 18:00