Hello,
I am trying to workout a way that will allow me to
run dynamic queries and display the results.
I have created an Access DB table Called "QueryTable" to
store all my queries in it.
The fileds are: qid (Auto Number), QueryName (Text),
SqlQuery (Memo).I have created a few select/insert queries
and have stored them in the db.
So far, so good.

I am then trying to run the queries on a cfm template and
display the results in <CFGRID> tag.

I have the following two templates:

Page1.cfm: (I am using this template to select the query
from my QueryTable).
Page2.cfm: This is where I have two queries:A & B.
Query A gets me the complete SQL statement based on the
QueryId selected in Page1.cfm.

Query B: This is where I am using the SQL statement
obtained previously from Query A to search my Book
Catalogue.
I am trying to Insert my SQL Statement between
the <CFQUERY> tags for QueryB.
The Codes:
Page2.cfm
<CFQUERY NAME="A" DATASOURCE="SOMEDATASOURCE">
Select QUERYID,SQLQUERY from QueryTable where
Queryid=#Form.queryid#
</CFQUERY>

<!--- Test if Query A is working--->
<CFOUTPUT> #A.SQLQUERY#</CFOUTPUT>
<!--- This line is OK.. the SQL statement is displayed with
no errors --->

<CFQUERY NAME="B" DATASOURCE="SOMEDATASOURCE">
#SQLQUERY#
</CFQUERY>
My problem is with is piece of code in QueryB.
It is creating an ODBC error.

Can someone please help.

Thanks in advance. Have a good day!

Morph
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to