More than one parameter in a search form (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


Guest -> More than one parameter in a search form (3/6/2001 13:49:00)

Hi
I have two or more variables (parameters) that I pass to another page, which then searches for the variable throughout the Access database.
The search (query) page works fine if I pass one parameter over, but if I pass two or more I receive "No Records Found."
My query is simple and frontpage 2000 generated.
fp_sQry="SELECT * FROM ""FlowParts Query"" WHERE (PART = '::PART::') ORDER BY PART ASC"
Thanks in advance!




regiii -> RE: More than one parameter in a search form (3/6/2001 14:26:00)

I'm the same guy who posted this parameter question. only difference is I just registered.
If you want to see what I'm trying to do, you can go to http://www.blue-white.net/Products/VariableArea/F-452/f452_exp.htm
If you click on the number 1, the search works great. If you click on number 7, it doesn't work.??
Thanks.




Mojo -> RE: More than one parameter in a search form (3/8/2001 17:56:00)

Rob,

You need to change your hyperlink and maybe your sql. Your link, for example should be:

link.asp?Part=76000-287,76000-333
Note the part numbers are seperated by a comma.

Your SQL should be something like:

"SELECT * FROM table WHERE Part IN (::Part::)"

This will work for multiple Part numbers and a single part number.

Good luck,

Joe

[This message has been edited by jbennett (edited 03-08-2001).]





Elecia -> RE: More than one parameter in a search form (3/8/2001 18:08:00)

[This message has been edited by Elecia (edited 03-08-2001).]





regiii -> RE: More than one parameter in a search form (3/8/2001 21:07:00)

Thanks for the advice, although it still doesn't work.

I've tried a dozen or more SQL statements and about the same number in hyperlink combinations.

I can't seem to understand the problem.

I've followed all the textbook rules. I don't think the query likes the variables I'm bringing over (more than one variable). I guess I need to dig into ASP and SQL a little more.

I'm feeling a little discouraged, but I can't give up.

Your feedback is totally appreciated!





Mojo -> RE: More than one parameter in a search form (3/9/2001 14:35:00)

Rob,

I have been playing with this a bit. I have it working fine, but then I wondered if it did not work for you because of your field values (example: 76000-333).

I have not been able to get it to work using your values. I am using Access and the fields need to be number fields not text to work. But, to use a number field your values are causing problems. 76000-333 is looking like 76000 minus 333. If you change your field values it will work using the example I have given above.

Since I don't know that much about such things I need to present my disclaimer...

I reserve the right to be an idiot. I reserve the right to not know what I am talking about. I reserve the right to not be showing you the best technique available.

**Whoof**

Joe





Spooky -> RE: More than one parameter in a search form (3/9/2001 21:56:00)

What SQL string are you using for 2 parts?
In your first message, I only see one variable?




regiii -> RE: More than one parameter in a search form (3/12/2001 22:59:00)

Maybe that's my problem. I only have that first part for my SQL statement. I'm dealing with a database that has over 3,000 records too (that's the size of our parts list). I've spent hours on this and no Frontpage book seems to help (nor access).
I did have the "PART" field labeled as TEXT. Now it's labeled as NUMBER without the dash (from 76000-333 to 76000333) and it still doesn't work.
I have exported this access database from our Informix database.
Thanks for the help!
Rob




regiii -> RE: More than one parameter in a search form (3/14/2001 19:08:00)

After doing some more research. I believe I have a better way to ask my question.
If this is my hyperlink:
http://testing/query.asp?part=76000-111&part=76000-222
This is the script that accepts the query, runs it and formats it.
<%
fp_sQry="SELECT * FROM floparts WHERE (part = ': art::')"
fp_sDefault="part="
fp_sNoRecords="<tr><td colspan=3 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="querytest"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=3
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
Once again, this works fine with one variable, but not two or more.
How can I rewrite this query to accept two or more variables for the same field?
Or do you think my problem is somewhere else (between keyboard and chair)?
Thanks for the help!




Spooky -> RE: More than one parameter in a search form (3/15/2001 20:09:00)

Itll do that, as you are using 2 variables of the same name.

Do this instead :

http://testing/query.asp?part1=76000-111&part2=76000-222

"SELECT * FROM floparts WHERE (part = '::part1::') OR (part = '::part2::') "

------------------
Spooky
"I am Spooky of Borg. Prepare to be assimilated, babycakes!"
Subscribe to OutFront News
Database / DRW Q & A
The Spooky Login!





regiii -> RE: More than one parameter in a search form (3/15/2001 18:38:00)

IT WORKS!!
Can't thank you enough!




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.1723633