Forums

This topic is locked

passing value from search page to results page

Posted 19 Sep 2001 03:43:35
1
has voted
19 Sep 2001 03:43:35 Val Dubuis posted:
I can not figure out why value is not getting passed from search page to results page. My "action" in form refers to results file (which is gsearch_res.asp), method is post and variable in recordset of results page is defined as name:
varGender

default value:
2

Run-time Value:
Request.Form("gender_m"

SQL statement is:
SELECT login_name, age, gender
FROM member_info
WHERE gender = 'varGender'
ORDER BY login_name

Test works but brings the default value of "2".

Any ideas what could be the problem?!!!!

Thank you in advance.

Replies

Replied 19 Sep 2001 10:49:08
19 Sep 2001 10:49:08 Owen Eastwick replied:
What values are held in the variable varGender?

Is the value held a text string or a number?

Your default value is numeric, but your WHERE clause is looking for varGender as a text string.

For Example:

WHERE gender = varGender - will look for a numeric match
WHERE gender = 'varGEnder' <b>or</b> WHERE gender LIKE 'varGender' will look for a text string match

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 19 Sep 2001 17:38:03
19 Sep 2001 17:38:03 Val Dubuis replied:
OK, I straightened that out - I thought...
But now I get an error "Data type mismatch, expecting string input" referring to this piece of code:
&lt;%
Dim gsearch_results__varGender
gsearch_results__varGender = 1
if (Request.Form(genderm)&lt;&gt; "" then gsearch_results__varGender = Request.Form(genderm)
%&gt;


Now I have following SQL statement:
SELECT login_name, age, email, tblGender.sex
FROM member_info, tblGender
WHERE member_info.gender = tblGender.gender AND tblGender.gender= varGender
ORDER BY login_name

Variable defined as:varGender
default value: 2
Run-time Value: Request.Form(genderm)




Replied 19 Sep 2001 19:10:36
19 Sep 2001 19:10:36 Val Dubuis replied:
Never mind - it's working now!
Thanks for your help, Owen!

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I can not figure out why value is not getting passed from search page to results page. My "action" in form refers to results file (which is gsearch_res.asp), method is post and variable in recordset of results page is defined as name:
varGender

default value:
2

Run-time Value:
Request.Form("gender_m"

SQL statement is:
SELECT login_name, age, gender
FROM member_info
WHERE gender = 'varGender'
ORDER BY login_name

Test works but brings the default value of "2".

Any ideas what could be the problem?!!!!

Thank you in advance.


<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Reply to this topic