Multi-Query, Multi-Parameter THING

Results 1 to 5 of 5

Thread: Multi-Query, Multi-Parameter THING

  1. #1
    Papa Zito Guest

    Default Multi-Query, Multi-Parameter THING

    Okay, so I&#039m recreating reports in this one database for use on our Intranet. Some of these reports use incredibly complex queries to generate their info. Several use 5-6 different queries, all chained in a row, to get a final result. This wouldn&#039t matter, except that there are also parameter inputs in different queries. For example :<BR><BR>Qry1(start - [Enter name]) ----&#062; Qry2([Enter Year]) ----&#062; Qry3(No parameter) ----&#062; Qry4([Enter Location])<BR><BR><BR>Since they&#039re all linked, I only need to call up the first query (Qry1, in this example). But I can&#039t get ASP to enter parameters for these others, and I can&#039t skip them without generating an error. Any ideas, other than rewriting the whole dang database? Thanks!

  2. #2
    Larry Fisher Guest

    Default RE: Multi-Query, Multi-Parameter THING

    I am assuming that you are using stored procedures for your queries. That being the case, you could call Q1 with the following syntax in ASP.<BR><BR>strVariableX = "EXEC Q1 &#039" & parameter1 & "&#039, &#039" & parameter2 & "&#039"<BR><BR>conn.execute (strVariableX)<BR><BR>In your stored procedure, you could use parameter1 in Q1, and have Q1 call Q2 with parameter 2.<BR><BR>example.<BR><BR><BR>This could go on and on for as many levels deep as you need. So you could call Q1 with 10 different parameters, and use one or two of them in Q1 then pass the remaining parameters to Q2. Use a couple more in Q2 and pass on the remainder to Q3 . . . etc.<BR><BR>Just an Idea. It worked for me in a brief test.<BR>

  3. #3
    Papa Zito Guest

    Default RE: Multi-Query, Multi-Parameter THING

    Well, it didn&#039t throw any errors at me, so that seems like a good sign. But how do I access the values to see? I&#039ve always used RecordSets before....

  4. #4
    Papa Zito Guest

    Default Nevermind! THANKS!

    Dude, this is completely awesome. You&#039ve solved a week&#039s worth of headache for me. Thank you SO much!

  5. #5
    Larry Fisher Guest

    Default RE: Nevermind! THANKS!

    Great! Glad to hear it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts