I have an sql query that will execute fine if tested in sql server manager.
Once I add a recordset to my asp page and set the appropriate paramaters only one of the parameters gets passed to the query. here is my buttonclick method code
Sub btnSearch_onclick()
'purpose: set the parameters for the recordset and cause the
' recordset to requery to get the desired results
dim key
dim disc
key=txtKey.value
disc=cmbDiscipline.getValue()
rcsLeadSearch.setParameter 1,key
rcsLeadSearch.setParameter 2,disc
rcsLeadSearch.requery()
if rcsLeadSearch.getCount()<1 then
searchMessage "Current search found no matches. Please adjust your search criteria and try again."
else
searchMessage ""
end if
End Sub
the parameters in the recordset are set as follows
In @vkeyword varchar 70 Request("txtKey"
In @nDisc int 0 Request("cmbDiscipline"
I can enter a keyword and that word gets passed to the query through the asp page. and the appropriate results are returned, but the discipline value is not being passed.
but the query works fine if tested on its own with out using the asp page.
If I reload the page I can even retrieve the number that was set in the recordset like this
txtProv2.value=rcsLeadSearch.getParameter(2)
and it shows the appropriate number that I selected in the cmbDiscipline text box. so the paramater is being set in the recordset but it isnt sending it to the query. The data types are the same in the recordset and the query. I have lost all hope with this. It should be working
Someone please help me
Once I add a recordset to my asp page and set the appropriate paramaters only one of the parameters gets passed to the query. here is my buttonclick method code
Sub btnSearch_onclick()
'purpose: set the parameters for the recordset and cause the
' recordset to requery to get the desired results
dim key
dim disc
key=txtKey.value
disc=cmbDiscipline.getValue()
rcsLeadSearch.setParameter 1,key
rcsLeadSearch.setParameter 2,disc
rcsLeadSearch.requery()
if rcsLeadSearch.getCount()<1 then
searchMessage "Current search found no matches. Please adjust your search criteria and try again."
else
searchMessage ""
end if
End Sub
the parameters in the recordset are set as follows
In @vkeyword varchar 70 Request("txtKey"
In @nDisc int 0 Request("cmbDiscipline"
I can enter a keyword and that word gets passed to the query through the asp page. and the appropriate results are returned, but the discipline value is not being passed.
but the query works fine if tested on its own with out using the asp page.
If I reload the page I can even retrieve the number that was set in the recordset like this
txtProv2.value=rcsLeadSearch.getParameter(2)
and it shows the appropriate number that I selected in the cmbDiscipline text box. so the paramater is being set in the recordset but it isnt sending it to the query. The data types are the same in the recordset and the query. I have lost all hope with this. It should be working
Someone please help me