Okay, since the search on the archives isn't working and I deleted all my
old messages from the email client, I'll have to post this one again.

I have a query that is being dynamically generated... I'm tired of building
tons of admin pages that are basically a lot of reworked code so I'm taking
some steps to genericise them to the point where I give the page a list of
fields and it will populate the form or build the SP call for me.

Here's the offending code:
<cfset QueryList="">
<cfloop List="#FormList#" index="CurrentRow" delimiters=";">
<cfset FieldName = ListGetAt(CurrentRow, 2, "~")>
<cfset Value = Evaluate("form.#FieldName#")>
<cfif ListGetAt(CurrentRow, 1, "~") EQ 1>
<cfset Value= "'" & Value & "'">
</cfif>
<cfset QueryList=ListAppend(QueryList, "@#FieldName#=#value#")>
</cfloop>

<cfquery name="qCompanies" datasource="#session.dsn#">
up_set_companies #queryList#
</cfquery>

When I execute the code ColdFusion is messing me up and escaping the single
quotes for me.  That's throwing an error with my SP calls.  Is there a way
around this?

Thanks!
Hatton

[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to