Why the error in one, but not the other

Why does this code Generate the error:
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 in
C:\Inetpub\wwwroot\2onboard\kBookList.cfm: line 40
38 : <tr>
39 : <td colspan="6">
40 : <cfif showList IS NOT "yearly"><a class="nav"
href=""> Yearly  </a>  </cfif>
41 : <cfif showList IS NOT "complete"><a class="nav"
href=""> Complete  </a>  </cfif>
42 : <cfif showList IS NOT "wish"><a class="nav"
href=""> Wish
List  </a>  </cfif>
CODE.........
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>2onboard.com - Kevin's Korner - Book
List</title>
<!--- SET DEFAULT VARIABLES --->
<cfparam name="showList" default="complete">
<cfparam name="showOrder" default="title">
<cfparam name="showStatus" default="own">
<!--- QUERIES --->
<cfquery name="showList" datasource="2onboard">
SELECT
title,author,status,completed,pages,queue,rating,cover,series,book,link
FROM books
WHERE status = '#showStatus#'
ORDER BY '#showOrder#'
</cfquery>
</head>
<body>
<div id="container"> <!--- GRAY ALL ENCOMPASING BOX
--->
<cfinclude template="header.cfm"> <!--- HEADER
--->
<cfinclude template="explanation.cfm"> <!---
EXPLANITION OF SCREEN BOX --->
<div class="raised"> <!--- CONTENT OF - HOME PAGE
--->
<b class="top"><b class="b1"></b><b
class="b2"></b><b class="b3"></b><b
class="b4"></b></b>
<div class="boxcontent">
<div class="boxcontenttext">
<table cellspacing="0">
<tr>
<td><span class="title">Kevin's
Korner</span><b> - Reading</b></td>
<td colspan="5"
align="right"><cfoutput> Library contains
<b>#showList.recordCount#</b>
books</cfoutput></td>
</tr>
<tr><td colspan="6"><span
class="spacetext"> </span></td></tr>
<tr>
<td colspan="6">
<cfif showList IS NOT "yearly"><a class="nav"
href=""> Yearly  </a>  </cfif>
<cfif showList IS NOT "complete"><a class="nav"
href=""> Complete  </a>  </cfif>
<cfif showList IS NOT "wish"><a class="nav"
href=""> Wish
List  </a>  </cfif>
</td>
CODE CONTINUES ON FROM HERE….
BUT, if I take just the bare minimum and test it as the
following, it works fine - WHY?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<cfparam name="showList" default="complete">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title> </title>
</head>
<body>
<cfif showList IS NOT "yearly"><a class="nav"
href=""> Yearly  </a>  </cfif>
<cfif showList IS NOT "complete"><a class="nav"
href=""> Complete  </a>  </cfif>
<cfif showList IS NOT "wish"><a class="nav"
href=""> Wish
List  </a>  </cfif>
</body>

> <cfparam name="showList" default="complete">
This line creates showList as a simple string variable
containing
"complete".
> <cfquery name="showList" datasource="2onboard">
This line redefines showList as a recordset containing the
data returned
from the database which is not a simple variable and can not
be accessed
with code such as <cfoutput>#showList#</cfoutput>
> <cfparam name="showList" default="complete">
This line does NOT redefine showList back to a simple string
because a
<cfparam ...> only fires if the variable does not
exist. The previous
two lines would create the variable, thus it exists.
jkgiven wrote:
> Why does this code Generate the error:
>
> 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 in
C:\Inetpub\wwwroot\2onboard\kBookList.cfm: line 40
>
> 38 : <tr>
> 39 : <td colspan="6">
> 40 : <cfif showList IS NOT "yearly"><a
class="nav"
>
href=""> Yearly  </a>  </cfif>
> 41 : <cfif showList IS NOT "complete"><a
class="nav"
>
href=""> Complete  </a>  </cfif>
> 42 : <cfif showList IS NOT "wish"><a
class="nav" href=""> Wish
>
List  </a>  </cfif>
>
>
> CODE.........
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
> "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="
http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
> <title>2onboard.com - Kevin's Korner - Book
List</title>
>
> <!--- SET DEFAULT VARIABLES --->
> <cfparam name="showList" default="complete">
> <cfparam name="showOrder" default="title">
> <cfparam name="showStatus" default="own">
>
> <!--- QUERIES --->
> <cfquery name="showList" datasource="2onboard">
> SELECT
title,author,status,completed,pages,queue,rating,cover,series,book,link
> FROM books
> WHERE status = '#showStatus#'
> ORDER BY '#showOrder#'
> </cfquery>
>
> </head>
>
> <body>
>
> <div id="container"> <!--- GRAY ALL ENCOMPASING
BOX --->
> <cfinclude template="header.cfm"> <!--- HEADER
--->
> <cfinclude template="explanation.cfm"> <!---
EXPLANITION OF SCREEN BOX --->
>
> <div class="raised"> <!--- CONTENT OF - HOME
PAGE --->
> <b class="top"><b class="b1"><b
class="b2"><b class="b3"><b
> class="b4">
> <div class="boxcontent">
> <div class="boxcontenttext">
> <table cellspacing="0">
> <tr>
> <td><span class="title">Kevin's
Korner</span>
- Reading</td>
> <td colspan="5"
align="right"><cfoutput> Library contains
>
#showList.recordCount# books</cfoutput></td>
> </tr>
> <tr><td colspan="6"><span
class="spacetext"> </span></td></tr>
> <tr>
> <td colspan="6">
> <cfif showList IS NOT "yearly"><a class="nav"
>
href=""> Yearly  </a>  </cfif>
> <cfif showList IS NOT "complete"><a class="nav"
>
href=""> Complete  </a>  </cfif>
> <cfif showList IS NOT "wish"><a class="nav"
href=""> Wish
>
List  </a>  </cfif>
> </td>
>
> CODE CONTINUES ON FROM HERE?.
>
> BUT, if I take just the bare minimum and test it as the
following, it works
> fine - WHY?
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
> "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="
http://www.w3.org/1999/xhtml">
>
> <cfparam name="showList" default="complete">
>
> <head>
> <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
> <title> </title>
> </head>
>
> <body>
>
> <cfif showList IS NOT "yearly"><a class="nav"
>
href=""> Yearly  </a>  </cfif>
> <cfif showList IS NOT "complete"><a class="nav"
>
href=""> Complete  </a>  </cfif>
> <cfif showList IS NOT "wish"><a class="nav"
href=""> Wish
>
List  </a>  </cfif>
>
> </body>
>
>
>

Similar Messages

  • I am trying to install windows 7 to my Macbook pro with bootcamp but every time I open bootcamp I am only able to check the first two boxes but not the third one saying "install or remove Windows 7", any solutions ?

    Hi, I am trying to install Windows on my MacBook Pro with bootcamp. Every time I open bootcamp I am only able to check the first two boxes but not the third one saying "install or remove Windows 7". I did this before using the same computer and the same hard drive so I am not sure why this is happening now but did´t happen then. Any solutions ?

    Was your Bootcamp info.plist manipulated to change any options?

  • Two email accounts, one password for both. will check one but not the other. Have had no problems before

    I have 2 email accounts for 2 people. TB will download mail for one but not the other. It can't authenticate the password. Passwords are both the same. Worked fine until today.

    The amount of information makes it somewhat hard to give a specific answer. I could only recommend:
    * Can you log into the account using the webmail service from your provider?
    * Have you verified the settings for the account to be correct (protocol, port number, password encoding)?
    The following page gives you a good start with resolving this issue:
    https://support.mozilla.org/en-US/products/thunderbird/fix-slowness-crashing-error-messages-and-other-problems/fix-problems-email-providers-gmail-yahoo-etc
    Hope this helps!

  • I have 2 iPod touchs and 1 computer. It will reconize one but not the other. How do I get it to sync music on both

    I have 2 older iPod touches and 1 computer. It will reconize one but not the other. How do I sync music on both?

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Look at the dock connector on the iPod. Look for abnormalities like bent or corroded contacts, cracked or broken plastic.
    - Make an appointment at the Genus Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • HT5622 How do I set icloud on 2 ipads.It recognises one,but not the other one?

    How do I set up icloud on 2 ipads? It recognises one but not the other one.

    Hi Leora Beisly,
    Thanks for visiting Apple Support Communities.
    Before setting up iCloud on your devices, I recommend updating to the latest iOS software version. This will ensure that you can use all of the iCloud features on your devices. See this article for information on updating your iPads:
    Update your iPhone, iPad, or iPod touch
    http://support.apple.com/kb/ht4623
    Next, see this page for iCloud setup instructions:
    iCloud: Set up iCloud on your devices
    http://support.apple.com/kb/PH2609
    Before you can use iCloud on each of your devices, you need to sign in to iCloud using your existing Apple ID or a new one, then turn on the iCloud features you want to use.
    You may have set up iCloud on your iOS device or Mac when you first used it. To make sure it’s set up correctly, or to set up your iCloud account on another iOS device, computer, or Apple TV, go to the set up iCloud website listed below.
    Important: Be sure to use the same Apple ID when you set up iCloud on each device.
    Best Regards,
    Jeremy

  • Certain music videos will not play in iTunes.  The music plays fine but not the video.  No picture.

    Certain music videos will not play in iTunes.  The music plays fine but not the video.  No picture.  Same with the iPod.  Other videos in the library play fine. Help.

    Regular playlists vs smart playlist does not make a difference. What I noticed is that some videos create this behavior and some not. I created 2 videos and 2 music playlists, one with 2 songs and 2 videos (that I encoded myself with Handbrake). Another list with 2 videos and 2 songs, videos encoded with Handbrake, but that I noticed they triggered the behavior. The first playlist played fine, with no problems. The second one, created the problem. When I look at the video, it is the same type of video (bit rate, audio channels, etc...) I don't see why it would do that.
    Later I will test: playing those videos in question and then selecting songs to see if they play.

  • I bought Mountain LIon but no dmg is downloaded. I can see the invoice from Apple but not the OS I supposed to receive. Is it a bugg?? I have a mac book air. Thanks

    xI bought Mountain LIon but no dmg is downloaded. I can see the invoice from Apple but not the OS I supposed to receive. Is it a bugg?? I have a mac book air. Thanks

    Thanks for the reply.
    However the trick is that it cannot download at all.I m asked to download the application. Then I put my Apple ID, then it start to download but just 1s... Then ....Nothing. No application, no error message... Just a nice invoice....

  • Is there a way of just changing the text to the main menu..but not the submenus?

    Is there a way of just changing the text to the main
    menu..but not the submenus?
    Also i have looked at in the browser and when i glide over
    the menu catergories or click on them they dont show the
    submenu...what can i do to solve this?

    Does the example described at
    http://labs.adobe.com/technologies/spry/articles/menu_bar/index.html
    work for you?
    What are you doing that's different from the example?
    When you say you just want to change the text of the main
    menu without changing the submenus, do you mean you want to do so
    dynamically, at some later stage after the page has loaded?
    If so, you could try retrieving the main menu elements you
    want to update from the DOM and updating them from your script's
    event handler for whatever event it is that you want to update them
    in response to. This presumes the widget will detect this and
    update appropriately, which I can't say for sure since I haven't
    actually tried it.
    Hope that helps!
    Rob

  • HT4993 My volume down button is not working.  The UP button works, but not the down button.  I have tried to restart it and that didn't solve the problem.

    My volume down button doesn't work on my iPhone.  The UP buttown works, but not the down button.  I have tried a hard reset and that didn't fix it.

    Try this.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • I want to de-install mac-excel test version and get the error message: you have not the privileges to de-install. Please login with the Mac-OS account you have installed mac-excel originally'. I don't know this account anymore. I am sysadm

    I want to de-install mac-excel test version and get the error message: 'You have not the privileges to de-install. Please login with the Mac-OS account you have installed mac-excel originally'. I don't know this account anymore. Possibly it does not exist anymore. anybody out there who can help ?

    Hi, I may suggest to activate the root account and try the uninstall process from that account. To do so, you have to:
    Go to System Preferences a open up the Users pane;
    On the left side of the pane, you shuold see Login Options;
    Enabled editing option clicking on the lock (it will ask your password);
    Once the pane is enabled, you should see something like Server Account Network (sorry my OS is in italian, so I don't exactly know the right translation), and right next to it a button;
    Click on that button, and a new pane shows up. Click on Open Directory Utility, and on the upper bar of OS X click on Edit;
    Select Enable Root Account (you can set a password, or not);
    Done that, you should log out and when the login window show up, type on the user field "root" and the password you choose;
    Theorically, from this account you will be able to unistall the application.
    After completing your task, I reccomend you to disable the root account, just by loggin in your personal account and repeating the steps I described before. Hope it helps

  • I am unable to forward pictures . the wording goes through but not the pictures

    When forwarding an email from someone the wording is transmitted but not the pictures. This is a new problem and I'm not sure what has happened
    == This happened ==
    Every time Firefox opened

    Firefox doesn't do email. Which web mail service are you using?

  • I am trying to update my primary e mail address and apple id to the same new address as suggested by Apple. I find that I cannot make that update. It updates the primary e mail but not the apple id.

    I am trying to update my account e mail address. I find that I can update the primary e mail but not the apple id. This is something that apple suggest is the same address but the update procedure does not seem to work as suggested. Any ideas?

    Hi gms12286!
    This article should be able to help you achieve this goal:
    Apple ID: Changing your Apple ID
    http://support.apple.com/kb/ht5621
    Thanks for coming to the Apple Support Communities!
    Cheers,
    Braden

  • I loaded iCloud on one of two MACs.  I can see the iCloud icon under "Preferences" on one but not the other.  WHY?

    I have 2 MACs and loaded iCloud on one of them.  I can see the iCloud icon on the MAC i loaded it on under  "Preferences" but not the second computer.  Why?

    Jay...
    Do you have v10.7.2 Lion installed on the second Mac?

  • 23" works on One but not the Other

    I have a Powerbook G4 1.25 GHz running 10.3.9 connected to a similar vintage 23" clear plastic case display with a DVI to ADC adapter connection and it works great.
    My husband recently bought a used Powerbook G4 1.67 GHz running 10.4.8. We thought sure that when I was out of town with my computer he could hook up and enjoy the use of my big display, but no luck. It just gives him a blank screen.
    Any suggestions as to why that would be? Does his machine require a different adapter? Is it possible his port is just not functioning?
    Thanks!
    Powerbook G4   Mac OS X (10.3.9)   23 inch display

    I couldn't remember what the Display Preferences had said when we tried this last spring and again in the summer, so tonight we connected it again, and wouldn't you know - it worked just fine. We didn't do anything different, so I have no clue as to why it worked this time but not before. He's thinking about getting his own big display, but didn't want to waste his money if he couldn't get it to work, so now I guess we're shopping for another 23" display - probably a used one. Thanks!

  • Does anyone know what the length is of the MacBook Air? I have the 11 inch one, but thats the height right?

    I have a MacBook Air, its the 11 inch one, but I would want to know if 11 inch is the height and whats the length or width?

    In the link I gave you in my first comment, there's a "Size and Weight" section where you can get this information. Anyway, here you have this data:
    Height: 0.11-0.68 inch (0.3-1.7 cm)
    Width: 11.8 inches (30 cm)
    Depth: 7.56 inches (19.2 cm)
    Weight: 2.38 pounds (1.08 kg)

Maybe you are looking for

  • How to modify a node value in a DOM tree?

    I have following code; it parses a XML file from a file and builds a in-memory DOM tree, but when I tries to modify one of the node value, it keeps telling me: oracle.xml.parser.v2.XMLDOMException: Node cannot be modified. How do I do it? // ========

  • Can't get F7 external monitor switch to work on 3000 N100

    I am trying to connect an external monitor to my Lenovo 3000 N100 but I can't get Fn-F7 to switch monitors. It does nothing at all. Can anyone help me? Running XP SP3.

  • THE ULTIMATE IRONY!

    Hello everybody... check out the copy below... this is how ADOBE describe FREEHAND on THIS website...pretty amazing eh! This poses the question to me, why not practice what you preach adobe! why don't you take a leaf out of your own (or macromedia's)

  • IPhone 3.0 software update for iPod touch

    I just bought the newest iPhone update for my iPod touch and everytime I try downloading it, it always comes up with an error message that says "There was a problem downloading the software for the iPod xxxxx. The network connection timed out - Make

  • Oracle 10.1, Whats the best way to load XML in database?

    Hi All, I am a typical Oracle developer. I know some Java and some XML technologies, but not an expert. I will be receiving XML files from some system, which will be, - of reasonable size like 2 to 15 MBs - of reasonable complexity, like the root ele