Is there a way I could call a saved MS ACCESS query from Cold Fusion.
I want to send a parameter to the query and then receive the answer(s)...
If yes which version of Cold Fusion it applays on.
i would not attempt to use this saved query, i would just construct a query against the base table in coldfusion, and insert your article number parameter into the coldfusion query
for example,
<CFPARAM NAME="url.article" DEFAULT="21">
<CFQUERY NAME="articlequery" DATASOURCE="#articles#">
select article_name
, Format(article_date, 'mmmm d, yyyy')
as published_date
, article_author
from articles
where article_number = #url.article#
</CFQUERY>
<CFIF articlequery.RecordCount>
<CFOUTPUT query="articlequery">
<p>#articlequery.article_name#<br />
#articlequery.published_date#<br />
#articlequery.article_author#</p>
</CFOUTPUT>
<CFELSE>
<p>Article #url.article# does not exist.</p>
</CFIF>
actually, tek, it's about "something similar to stored procedures ... what Access calls queries or parameter queries."
the author further goes on to say...
"While this trick in using Access is nifty, be aware that it doesn't really open up the full range of complex programmatic SQL typically available in full-fledged DBMSs like Oracle or SQL Server. You can't specify any sort of conditional logic in the query, nor does Access support use of temporary tables. You can only perform "simple" SQL, which you could have done in a CFQUERY."
Yes, I remember reading the article in CFDJ (when I subscribed to it and it wasn't an expensive POS like it mostly is now). I figured I wouldn't explain the article and just let one read it for themselves, but then again, I am an RTFM kinda guy so I always assume everyone else is!
I did think the article was interesting because at that time (1999) I wasn't working much with SQL Server yet as I'd just started using CF 4.0.
I would guess that if one has to use Access then the methods the article mentions are definitely something to look into. I have no idea about performance issues, however.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.