Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL/ASP/ACCESS Query question. PLEASE HELP...

Status
Not open for further replies.

Dudboy

Programmer
Jul 17, 2001
2
GB
Why does this work

sqltext = "SELECT * FROM Forsale WHERE Category_Name = 'Spares' ORDER BY Sale_Price "

But when I send the Spares in as a variable from a query string.

sqltext = "SELECT * FROM Forsale WHERE Category_Name = "& Choice &" ORDER BY Sale_Price "

It doesn't

Querystring gained here and sent to the same page

<option value=&quot;classifieds.asp?Pref=<%= Searches(&quot;Category_Name&quot;) %>&quot;>

Then grabbed back here

<% If request.Querystring(&quot;Pref&quot;) <> &quot;&quot; Then

Set Choice = request.QueryString(&quot;Pref&quot;)
%>

I can write it out to the page no problem so it is being carried accross ok.

<%= Choice %>

Just the SQL query that fails and gives this error.

Too few parameters. Expected 1.

Been stuck on this for ages now and it's starting to drive me nuts. Any help would be excellent.
 
I found the mistake but now can't delete this post.

Thanks anyway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top