Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Basic (newbie) ASP question?

Posted on 1998-07-20
4
Medium Priority
?
175 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Author Comment

by:bhummel
ID: 1466250
Edited text of question
0
 
LVL 2

Accepted Solution

by:
Jagar earned 300 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

610 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