QueryString in Classic ASP

Hi Experts!
I'm trying to send values through a form in the following format:

<form method="get" action="RecallSearchResult.asp" style="margin-top:0px;">
    <button type="submit">View Processed Records</button>
	<%If Request.Form("Affiliation") = "" Then%><%Else%><input type="hidden" name="Affiliation" value="<%=Request.Form("Affiliation")%>" /><%End If%>
	<%If Request.Form("DeviceName") = "" Then%><%Else%><input type="hidden" name="DeviceName" value="<%=Request.Form("DeviceName")%>" /><%End If%>
	<%If Request.Form("DEVTYPE") = "" Then%><%Else%><input type="hidden" name="DEVTYPE" value="<%=Request.Form("DEVTYPE")%>" /><%End If%>
	<%If Request.Form("ActiveHost") = "" Then%><%Else%><input type="hidden" name="ActiveHost" value="<%=Request.Form("ActiveHost")%>" /><%End If%>
	<%If Request.Form("DeviceAccountID") = "" Then%><%Else%><input type="hidden" name="DeviceAccountID" value="<%=Request.Form("DeviceAccountID")%>" /><%End If%>
</form>
</center>

Open in new window


The WHERE clause on the RecallSearchResult.asp looks like this:

SELECT * FROM QueueProcessor WHERE (Affiliation LIKE '%" & Request.Form("Affiliation") & "%' AND DeviceName LIKE '%" & Request.Form("DeviceName") & "%' AND DEVTYPE LIKE '%" & Request.Form("DEVTYPE") & "%' AND DeviceAccountID LIKE '%" & Request.Form("DeviceAccountID") & "%')

Open in new window


Unfortunately all records are returned, not only the ones sent by the If Statement of the form.

Is there a way that the WHERE clause can be modified to retrieve only the records I  need?
Or is there a better way to achieve my goal?

I would appreciate your help.
romsomAsked:
Who is Participating?
 
Manuel Marienne-DuchêneITMCommented:
If you use "get" you get back with request.querystring, if you use post you get back with request.form
0
 
romsomAuthor Commented:
Thank you so much! I changed it to "post" and now it returns the expected results.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.