bhummel
asked on
Basic (newbie) ASP question?
Greetings,
I have been working with VB for a number of years and am starting to use ASP. My question is:
How do I carry the value of a drop down list (a list of company's) in an ASP page to a second results page. I just need the syntax for applying the Company criteria to the second recordset.
It's probably very easy, at least it is in Cold Fusion, but I want to learn the ASP way of doing things.
Thanks,
Brad
I have been working with VB for a number of years and am starting to use ASP. My question is:
How do I carry the value of a drop down list (a list of company's) in an ASP page to a second results page. I just need the syntax for applying the Company criteria to the second recordset.
It's probably very easy, at least it is in Cold Fusion, but I want to learn the ASP way of doing things.
Thanks,
Brad
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi brad
If your Dropdownlist has a name and your form has the method "post", you only have to submit the form and on the results page, you can get the the value of the DD with folowing code:
x = Request.QueryString("[List name]")
If you had an multiple DD the values are seperated with ","
Ciao mario
If your Dropdownlist has a name and your form has the method "post", you only have to submit the form and on the results page, you can get the the value of the DD with folowing code:
x = Request.QueryString("[List
If you had an multiple DD the values are seperated with ","
Ciao mario
ASKER
Thanks for your help.
I seem to be having some problems connecting the 2 pages though. Each time I run this I get a no records found.
The problem is when I try to add x, or criteria to the WHERE clause of the SQL.
<%
Set DataConn = Server.CreateObject("ADODB .Connectio n")
DataConn.Open "DSN=Contacts", "webuser", "webuser"
criteria = Request.Form("Combo1") **Name of Form**
or
criteria = Request.QueryString("Compa nyName")
** I've tried both **
q2 = "SELECT CompanyName, Dear, FirstName ,LastName, WorkPhone, EMailName FROM Contacts WHERE CompanyName = 'criteria'"
Set rs2 = DataConn.Execute (q2)
ary = rs2.GetRows(5) **Used for my table formatting**
rs2.close
%>
Each time I call resuls.asp I get a no records found. When I know records exist.
What am I doing wrong?
Thanks,
Brad
I seem to be having some problems connecting the 2 pages though. Each time I run this I get a no records found.
The problem is when I try to add x, or criteria to the WHERE clause of the SQL.
<%
Set DataConn = Server.CreateObject("ADODB
DataConn.Open "DSN=Contacts", "webuser", "webuser"
criteria = Request.Form("Combo1") **Name of Form**
or
criteria = Request.QueryString("Compa
** I've tried both **
q2 = "SELECT CompanyName, Dear, FirstName ,LastName, WorkPhone, EMailName FROM Contacts WHERE CompanyName = 'criteria'"
Set rs2 = DataConn.Execute (q2)
ary = rs2.GetRows(5) **Used for my table formatting**
rs2.close
%>
Each time I call resuls.asp I get a no records found. When I know records exist.
What am I doing wrong?
Thanks,
Brad
ASKER