Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

htmlstring from DB to cf page 1

Status
Not open for further replies.

Kenvase

Programmer
Nov 11, 2000
15
SE
I'm trying to get html content as a string from an Access database and use that content to fill in a section of a cf page. The problem is that the content itself contains CF code which is not interpreted by ColdFusion after it is selected and displayed. How the ... do I get this to work ?
 
Kenvase,

CF parses scripts, not data from DBs. You'd have to write the code to a .cfm file, and CFINCLUDE it in your target template:

<cfquery name=&quot;getcode&quot; datasource=&quot;#dsn#&quot;>
select snippet from mytable
where #myparameters#
</cfquery>

<cffile action=&quot;write&quot; file=&quot;#fullpathtoauniquefile#&quot; output=&quot;#getcode.snippet#&quot; nameconflict=&quot;overwrite&quot;>

<cfif FileExists(&quot;#fullpathtoauniquefile#&quot;)>
<cfinclude template=&quot;#fullpathtoauniquefile#&quot;>
</cfif>

[tag and attribute accuracy not guaranteed; it's the weekend.]


HTH,

philh
iimaksmall.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top