Recently, I upgraded coldfusion 5.0 to coldfusion mx 6.1. However, I am getting the following error message when I try to run the pages in the browser: Complex object types cannot be converted to simple values. The expression has requested a variable or an intermediate expression result as a simple value, however, the result cannot be converted to a simple value. Simple values are strings, numbers, boolean values, and date/time values. Queries, arrays, and COM objects are examples of complex values. The most likely cause of the error is that you are trying to use a complex value as a simple one. For example, you might be trying to use a query variable in a <CFIF> tag. This was possible in ColdFusion 2.0 but creates an error in later versions. The code is: <cfif isdefined("attributes.act")> <cfset url = "act_"&"#attributes.act#"&".cfm"> <cfinclude template = "#url#"> <cfelseif isdefined("attributes.dsp")> <cfset url = "dsp_"&"#attributes.dsp#"&".cfm"> <cfinclude template = "#url#"> <cfelse> <cfinclude template="dsp_main.cfm"> </cfif> and the error is on line. I'm new to coldfusion and not sure what is wrong. Can anyone help? Thanks
a lot of issues arrised with my scripts as well when converting from 5 to 6 You should contact the person that created the script...
what line is the error on - I just got up - maybe I'm not seeing it. Also you could done: <cfset url = "act_" & attributes.act & ".cfm"> and <cfset url = "dsp_" & attributes.dsp & ".cfm"> But I doubt that's your problem. I believe what most of us want to see is the 'type' of data that is in attributes.dsp and attributes.url. Could you show where you populated these variables. And what line number is the error on?
Actually, are you doing any dynamic variable setting? Instead of "Eval"ing variables, i converted them to the old-school <cfparam's and it fixed all my issues.