Bad Error Message
I recently did this:
<cfoutput query="#queryName#"> ... </cfoutput>
Can you spot the error?
I think that is probably a very common mistake - here's the error message you get in ColdFusion MX 6.1:
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 error occurred on line 14.
I realize that this is a generic error message, but in this case - for what is probably a very common thing to do - why not something like You passed in a query object, when we expected the name of a query. You may need to remove the pound signs..
Tweet
add to del.icio.us
| Tags: exceptions, cfoutput, cfml, errors, error message
Related Entries
- Spelling Strikes Again - November 16, 2007
- Error Jargon - January 9, 2006
- Google says disable your firewall - December 10, 2005
Trackbacks
Comments
The error at least tells you that you need "IS" instead of "=", but if it can figure out exactly what you did wrong, why not just do what it seems to know you meant?!
Don't get my wrong, it's not just a Macromedia thing, lots of software companies are guilty of this.
Iam talking with w.r.t coldfusion MX.
If ur getting an error "ByteArray Object cannot be converted to String" Follow this procedure. Here #id# is a ByteArray Object
<cfset aAbcArray = ArrayNew(1)> <cfset aAbcArray[1] = #id#> <cfset ArrayAppend(aAbcArray, "")> <cfset one = aAbcArray> <cfset one = #BinaryEncode(#id#,'Hex')#> <cfoutput>#one<cfoutput>
Remember ByteArray Object is a complex data type and cannot be converted to simple data type. If u find this problem then use the array value directly instead of #one# value. Like this 'aAbcArray.value'
Rauf
<cfset qry = createObject("component"...
<cfoutput query="#qry.getContent()#">...
That would be very nice indeed!!
P.S. Pete... could you add xmlFormat or HTMLEditFormat to your RSS feed.. that way I can view the CF code in my RSS reader (Feeddemon in my case);-) txns!! Oh wait.. you have that.. hmmm strange Feeddemon doesn't show me the code :-(
I'm not sure why you can't get view the code in your RSS reader... I am pretty sure its all valid xml, I'll look into it.
-pete
I put this into a variable. But when i try to display the variable, i get the error message: "ByteArray Object cannot be converted to String"
Query name = Get_Product
Variable = #Get_Product.Photo# I also tried it with Quotes but then that just gave me the box with the X thru it.
Any clue? Anyone?
Post a Comment
Recent Entries
- Writing Secure CFML cfObjective 2013 Slides
- Upgrading to Java 7 on Linux
- J2EE Sessions in CF10 Uses Secure Cookies
- Learn about ColdFusion Security at cfObjective 2013
- Session Loss and Session Fixation in ColdFusion
- FuseGuard 2.3 Released
- CKEditor Spell Checker Plugin
- Adobe Says Go Ahead and Upgrade your ColdFusion JVM





