Solved

Basic (newbie) ASP question?

Posted on 1998-07-20
4
167 Views
Last Modified: 2010-05-03
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
0
Comment
Question by:bhummel
  • 2
4 Comments
 

Author Comment

by:bhummel
Comment Utility
Edited text of question
0
 
LVL 2

Accepted Solution

by:
Jagar earned 100 total points
Comment Utility
You have a form on the first screen with the action property set to the second page that you want to process the selection from the list.  Then in the second page you use a statement like the following

criteria = Request.Form("Combo1")
0
 

Expert Comment

by:mario_ba
Comment Utility
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("[Listname]")

If you had an multiple DD the values are seperated with ","
Ciao mario
0
 

Author Comment

by:bhummel
Comment Utility
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.Connection")
      DataConn.Open "DSN=Contacts", "webuser", "webuser"

      criteria = Request.Form("Combo1") **Name of Form**
        or
        criteria = Request.QueryString("CompanyName")
        ** 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
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now