Solved

Basic (newbie) ASP question?

Posted on 1998-07-20
4
171 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
ID: 1466250
Edited text of question
0
 
LVL 2

Accepted Solution

by:
Jagar earned 100 total points
ID: 1466251
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
ID: 1466252
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
ID: 1466253
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How does CurrentUser work? 10 41
vb6 connector to mongodb 2 138
Prevent checkbox click event occur while editing it in vb6 8 63
VBA: Insert New column with specific format type 12 52
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…

679 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