Skip to main content
Known Participant
June 11, 2009
Question

How to define source value for filtered recordset (ASP)

  • June 11, 2009
  • 2 replies
  • 646 views

Hi,

I'm using ASP & CS4. I have a search page which upon submission sends form parameters to a results page. The results page matches the search parameters to a recordset and returns the appropriate record/s.

How can I take one of the values from the returned filtered recordset (which wasn't one of the original variables/parameters), and use it as a value to filter another recordset from another table? Do I have to create a parameter from that value, or can it be done in a SQL statement?

Many thanks

This topic has been closed for replies.

2 replies

Participating Frequently
June 15, 2009

How many results are returned from the first recordset? Where is the second recordset to be displayed?

If the first RS returns a single row and the second RS is displayed on the same page, you don't need to create anything. Just use the value of the column you want in the SQL statement. If you need to pass the value to another page, you can either set a session variable or pass the value in the querystring.

Participating Frequently
June 15, 2009

Oh, and if you are just asking whether or not you need to use a parameterized query, no, you do not. You can simply reference the RS variable directly in the select statement.

iandobieAuthor
Known Participant
June 14, 2009

So,

does any one know how I can generate form or URL parameters, or session variables, from certain information returned by my filtered recordset on my results page? Any help would be greatly appreciated.