SunQuest
           ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old October 7th, 2004, 10:50 PM
myhomie myhomie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 20 myhomie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
No results with checkbox field in search

Everything is working when I search for the text or drop-down fields, except for the checkbox field. Here is my code:

SELECT * FROM ALUMNA
WHERE 0=0
<cfif Len(Form.maj)>AND MAJOR='#Form.maj#'</cfif>
<cfif IsDefined("Form.host") >AND WILLHOST='#Form.host#'</cfif>
<cfif Len(Form.fname)>AND FIRSTNAME='#Form.fname#'</cfif>
<cfif Len(Form.lname)>AND LASTNAME='#Form.lname#'</cfif>
<cfif Len(Form.profession)>AND PROFESSION='#Form.Profession#'</cfif>
<cfif Len(Form.state)>AND STATE='#Form.State#'</cfif>

**************
When I try to check the checkbox and do a search the error message is:

ODBC Error Code = 22005 (Error in assignment)


[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.


SQL = "SELECT * FROM ALUMNA WHERE 0=0 AND WILLHOST=''"


*****

In my form with the checkbox field, this is what I have:
<cfinput name="host" type="checkbox" value="" required="no">

*************
Do you have any suggestions for this problem...thanks!

Reply With Quote
  #2  
Old October 8th, 2004, 09:08 AM
CfFreelancer CfFreelancer is offline
CF Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Long Island, NY
Posts: 34 CfFreelancer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 29 m 50 sec
Reputation Power: 5
you need to set a value for the checkbox, is "willhost" a bit field, if so set the value to 1

e.g. <input type="checkbox" name="host" value="1">

Reply With Quote
  #3  
Old October 8th, 2004, 09:21 AM
myhomie myhomie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 20 myhomie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by CfFreelancer
you need to set a value for the checkbox, is "willhost" a bit field, if so set the value to 1

e.g. <input type="checkbox" name="host" value="1">



No, it is not a bit value- in access, it is a yes/no value (yes if they can host someone, or yes if checked)
So should the value by yes/no, or should something change in my sql statement?

Reply With Quote
  #4  
Old October 8th, 2004, 11:02 AM
CfFreelancer CfFreelancer is offline
CF Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Long Island, NY
Posts: 34 CfFreelancer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 29 m 50 sec
Reputation Power: 5
value should be set to whatever is stored in the corresponding field, the stmt is fine, just change the value

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > No results with checkbox field in search


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway