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.