?
Solved

Bind expressions cannot be empty.(coldfusion)

Posted on 2009-05-12
2
Medium Priority
?
802 Views
Last Modified: 2013-12-20
Hello experts.
I have a query:
<cfquery name="getmodell" datasource="#request.dsn#">
SELECT Modell
From Artikel
WHERE Mobile_Sub_ID = <cfqueryparam cfsqltype="cf_sql_integer" value="#Url.Mobile_Sub_ID#">
Order by Modell ASC
</cfquery>
<cfset modellist= valuelist(getmodell.Modell,',')>

And a cfinput:
<cfinput  type="text" name="S_Modell" Autosuggest="#modellist#" />

If i don't have any records (recordcount = 0) i have the error Bind expressions cannot be empty.
Any help to solve the problem?
0
Comment
Question by:Panos
2 Comments
 
LVL 27

Accepted Solution

by:
azadisaryev earned 2000 total points
ID: 24373697
wrap your <cfinput> in a <cfif> block checking for listlen(modellist), and if list is empty, show a plain text input box (without autosuggest):

<cfif listlen(modellist)>
  <cfinput  type="text" name="S_Modell" Autosuggest="#modellist#" />
<cfelse>
  <cfinput  type="text" name="S_Modell" />
</cfif>

Azadi
0
 
LVL 2

Author Closing Comment

by:Panos
ID: 31580861
Thank you azadi fr yur help
regards
panos
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question