I am trying to use the "evaluate" function as specified below, but due to
our client using CF 4.0 vice CF 4.5, I think I am limited?

Does anyone know how to possibly get around this in version 4.0?

-----------------------------------------------------------

<html>
<head>
</head>
<body bgcolor="#C0C0C0">
        <cfif isdefined("form.submit")>

                <!--- Dynamice Query --->
                <!--- <cftry>    --->
                        <cfquery name="dynQuery" datasource="qol">
                                #form.sql#
                        </cfquery>

                                <!--- Outputting query --->

                                <cfset columns = ListtoArray(#dynQuery.ColumnList#)>
                                <cfset numColumns = arraylen(#columns#)>

                        <table border="1" cellpadding="1" cellspacing="1">
                                <cfloop index="i" from="1" to="#numColumns#">
                                        <cfoutput><th>#columns[i]#</th></cfoutput>
                                </cfloop>

                                <cfloop query="dynQuery">
                                        <tr>
                                                <cfloop index="i" from="1" 
to="#numColumns#">
                                                        <td>
                                                                <cfoutput>
                                                                        <cfif 
evaluate(columns[i]) EQ "">
                                                                                &nbsp;
                                                                        <cfelse>
                                                                                
#evaluate(columns[i])#
                                                                        </cfif>
                                                                </cfoutput>
                                                        </td>
                                                </cfloop>
                                        </tr>
                                </cfloop>
                        </table>

                <!--- Catching any type of error. --->
                <!--- <cfcatch type="Any">
                        You have caused an error!  Please hit your back button and try 
again.
                </cfcatch>
                </cftry> --->

        <!--- First time through form --->
        <cfelse>

        <h3>  Please Enter a SQL Statement below</h3>

        <cfform action="#cgi.script_name#?#cgi.Query_String#" method="post">

                <textarea cols="50" rows="5" name="SQL">
                SELECT          *
                FROM            d_offense
                </textarea>
                <br>
                <input type="Submit" name="submit">
        </cfform>
        </cfif>
</body>
</html>

-----------------------------------------------------------

Best Regards,

Gil Barden

Best Regards,

Gil Barden


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to