Ask a Question related to ASP Database, Design and Development.
-
Bob Barrows [MVP] #1
Re: Passing Query Parameters in Sub-Queries
coder23 wrote:
'1/1/2004' ???> I have a Query in Access titled "SR_Control"
>
> I know you can pass values from ASP to the Query with:
> SQL = "SR_Control '1/1/2004', '5/1/2004', 'Blue'"
Shouldn't it be #'1/1/2004# ? Or are these Text parameters?
You need to create another saved query for this:> rs1.Open SQL, cn1, etc... etc....
>
> ... but is there a way to call the Query and Pass values to it from
> an SQL string? for example: SQL2 = "SELECT * INTO test2 FROM
> (SR_Control '1/1/2004', '5/1/2004', 'Blue');" - or -
> SQL2 = "SELECT * INTO test2 FROM (" & SQL1 & ");"
>
> (the attempts above return errors.)
In Access, create a query with this sql:
SELECT * INTO test2 FROM [SR_Control]
Test it and verify that you get prompted for the parameter values.
Save it, calling it something like qCreateTableFromSR_Control. then call it
in ASP instead of SR_Control.
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Bob Barrows [MVP] Guest
-
Passing Parameters To CFC
I am testing how to return data from a CFC within Flash Forms. I have a simple <cfselect> tag that will hold data returned from a CFC. This CFC... -
Query of Queries on query New type query
In CF5 we have a page that creates a query, using queryNew and querySetCell and the like, we then used dbtype="query" and gave it's name so we could... -
Passing Queries
This is the first time I am posting here so I hope nobody panics if this is the wrong section for this question...... Anyway, I have created a... -
passing parameters
Hi Michael, I think you want to modify the links in web control programmatically. You can add several Hyperlink controls to the user control,... -
Alternate for passing parameters for dbase query?
And perhaps this could give you some ideas about avoiding querystrings: ASP Design Tips - Post Back Page... -
coder23 #2
Re: Passing Query Parameters in Sub-Queries
thanks Bob. that definitely works, but I wanted to use the SQL String because I needed to specify the name of the table.
SQL2 = "SELECT * INTO " & tableName & " FROM (SR_Control '1/1/2004', '5/1/2004', 'Blue');
is there an easy way to do this
----- Bob Barrows [MVP] wrote: ----
coder23 wrote'1/1/2004' ??> I have a Query in Access titled "SR_Control> SQL = "SR_Control '1/1/2004', '5/1/2004', 'Blue'>> I know you can pass values from ASP to the Query with
Shouldn't it be #'1/1/2004# ? Or are these Text parameters
You need to create another saved query for this> rs1.Open SQL, cn1, etc... etc...> an SQL string? for example: SQL2 = "SELECT * INTO test2 FRO>> ... but is there a way to call the Query and Pass values to it fro
> (SR_Control '1/1/2004', '5/1/2004', 'Blue');" - or
> SQL2 = "SELECT * INTO test2 FROM (" & SQL1 & ");>> (the attempts above return errors.
In Access, create a query with this sql
SELECT * INTO test2 FROM [SR_Control
Test it and verify that you get prompted for the parameter values
Save it, calling it something like qCreateTableFromSR_Control. then call i
in ASP instead of SR_Control
Bob Barrow
--
Microsoft MVP -- ASP/ASP.NE
Please reply to the newsgroup. The email account listed in my Fro
header is my spam trap, so I don't check it very often. You will get
quicker response by posting to the newsgroup
coder23 Guest



Reply With Quote

