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.
romsomIT DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
romsomIT DeveloperAuthor Commented:
Thank you so much! I changed it to "post" and now it returns the expected results.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.