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

Asked

Viewed 154 times

0

I have a system in ASP Classico, and I’m trying to run a SQL Server process passing two parameters.

Originally I was only passing a date selected on a datepicker and it worked, now I want to pass an int value obtained in a combo (containing the values 1, 2 and 3).

The values are being sent through the function when I click on 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 loaded.Asp receives these values:

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

And creating the call for the trial:

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 giving problem is this @Homolog.

When I click on the button that calls Procedure gives the following error message:

O procedimento ou a função 'HorarioDisponivelHomolog' espera o parâmetro '@homolog' que não foi fornecido.

1 answer

0

Includes the Homolog field as value at the end of the line, along with the size

.Parameters.Append .CreateParameter("@homolog", adInteger, adParamInput, 1 homolog)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.