I have a system in Classic Asp, and I need to execute a specific SQL Server procedure, according to a parameter that the system receives from a form.
I tried to do this:
if tipoagenda = 1 then
ssql1 = "exec VerificaDataDisponivel"
elseif tipoagenda = 2 then
ssql1 = "exec VerificaDataDisponivel_Pedido"
else
ssql1 = "exec VerificaDataDisponivel_Reagenda"
end if
or so:
.CommandType = adCmdStoredProc
if tipoagenda = 1 then
.CommandText = "HorarioDisponivelHomolog"
elseif tipoagenda = 2 then
.CommandText = "HorarioDisponivelHomolog_Pedido"
else
.CommandText = "HorarioDisponivelHomolog_Reagenda"
end
But it gives error saying 'if' expected at line 31 end '
Is it possible to do this?