I have a query like this:
SELECT TaFellesVaktjournal.*, TaBygg.ByggNavn
FROM TaFellesVaktjournal LEFT JOIN TaBygg ON
TaFellesVaktjournal.VaktFellesByggNavnId =
TaBygg.ByggBudsjtilstEiendom WHERE VaktjFellesDato
>= @dtfr AND VaktjFellesDato <= @dttl AND (VaktFellesSak
= @sok OR VaktjFellesHendelse = @sok) ORDER BY
VaktjFellesDato DESC, VaktjFellesTid DESC
However, I get an error stating that No value given for one or more required parameters.
.
I've specified values for @dtfr, @dttl and @sok. Also, the error goes away if I remove the parts containing @sok (everything after @dttl) to the ORDER BY.
I've made shure I specify values for sok, and that it's not empty. I've even tried specifing 2 parameters named sok (since they are two places). Anyone know how I can do this?
The code I use to create parameters is as following:
Dim conn, cmd, param
set cmd = server.createobject("adodb.command")
set param = server.createobject("adodb.parameter")
set param = cmd.createparameter("@sok", adVarChar, adParamInput, 255, sok)
cmd.parameters.append param