Here is the error message:
ODBC Error Code = 22005 (Error in assignment)
[Microsoft][ODBC Microsoft Access Driver]Invalid character value for cast specification (null)
The error occurred while processing an element with a general identifier of (CFUPDATE), occupying document position (65:1) to (66:192).
I have checked all my field names, as well my access database for allowing zero length and not required. These are all set ok. Any idea how to make this error go away? Only when I pull a record then update, I get the error when writing the update.
Code: (it's all here)
DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
ODBC Error Code = 22005 (Error in assignment)
[Microsoft][ODBC Microsoft Access Driver]Invalid character value for cast specification (null)
The error occurred while processing an element with a general identifier of (CFUPDATE), occupying document position (65:1) to (66:192).
I have checked all my field names, as well my access database for allowing zero length and not required. These are all set ok. Any idea how to make this error go away? Only when I pull a record then update, I get the error when writing the update.
Code: (it's all here)
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>CozyInns.com, BNB Admin Page</title>
</head>
<body bgcolor="#FFFFff">
<!--- Make sure the URL.Action has a value --->
<cfparam name="URL.Action" default="New">
<cfswitch expression="#URL.Action#">
<cfcase value="Load">
<cfquery name="get_listing" Datasource="CozyInns">
select *
from listings
where listing_num=#Form.listing_num#
</cfquery>
</cfcase>
<cfcase value="Insert">
<!---Insert the New B and B --->
<cfquery name="get_listing" datasource="CozyInns">
insert into listings (listing_type, listing_headline, price, bed, bath, square_feet, description, movie, pic1, pic2, pic3, pic4, pic5, pic6, pic7, pic8, pic9, pic10, pic11, pic12, pic13, pic14, pic15)
values ('#Form.listing_type#', '#Form.listing_headline#', '#Form.price#', '#Form.bed#', '#Form.bath#', '#Form.square_feet#', '#Form.description#', '#Form.movie#', '#Form.pic1#', '#Form.pic2#', '#Form.pic3#', '#Form.pic4#', '#Form.pic5#', '#Form.pic6#', '#Form.pic7#', '#Form.pic8#', '#Form.pic9#', '#Form.pic10#', '#Form.pic11#', '#Form.pic12#', '#Form.pic13#', '#Form.pic14#', '#Form.pic15#')
</cfquery>
<!---Retrieve matching records--->
<cfquery name="get_listing" datasource="CozyInns">
select *
from listings
where listing_headline='#Form.listing_headline#'
order by listing_num ASC
</cfquery>
<!--- Check if this is the only available record --->
<cfif get_listing.RecordCount greater than 1>
<cfloop query="get_listing" startrow=#get_listing.RecordCount# endrow=#get_listing.RecordCount#>
<cfquery name="get_listing" datasource="CozyInns">
select *
from listings
where listing_num='#listing_num#'
</cfquery>
</cfloop>
</cfif>
</cfcase>
<cfcase value="Update">
<!--- Update the record --->
<cfupdate datasource="CozyInns" tablename="listings"
formfields="listing_type, listing_headline, price, bed, bath, square_feet, description, movie, pic1, pic2, pic3, pic4, pic5, pic6, pic7, pic8, pic9, pic10, pic11, pic12, pic13, pic14, pic15"></cfupdate>
<!--- Recall the record --->
<cfquery name="get_listing" datasource="CozyInns">
select *
from listings
where listing_num=#Form.listing_num#
</cfquery>
</cfcase>
</cfswitch>
<cfif IsDefined("listing_num")>
<cfset listing_type=get_listing.listing_type>
<cfset listing_headline=get_listing.listing_headline>
<cfset price=get_listing.price>
<cfset bed=get_listing.bed>
<cfset bath=get_listing.bath>
<cfset square_feet=get_listing.square_feet>
<cfset description=get_listing.description>
<cfset movie=get_listing.movie>
<cfset pic1=get_listing.pic1>
<cfset pic2=get_listing.pic2>
<cfset pic3=get_listing.pic3>
<cfset pic4=get_listing.pic4>
<cfset pic5=get_listing.pic5>
<cfset pic6=get_listing.pic6>
<cfset pic7=get_listing.pic7>
<cfset pic8=get_listing.pic8>
<cfset pic9=get_listing.pic9>
<cfset pic10=get_listing.pic10>
<cfset pic11=get_listing.pic11>
<cfset pic12=get_listing.pic12>
<cfset pic13=get_listing.pic13>
<cfset pic14=get_listing.pic14>
<cfset pic15=get_listing.pic15>
<cfset listing_num="<strong>Listing Number is: #get_listing.listing_num#</strong>
<input type=hidden name=listing_num value=#get_listing.listing_num#>">
<cfset Submit="UPDATE">
<cfset FormAction="Update">
</cfif>
<cfparam name="listing_type" default="">
<cfparam name="listing_headline" default="">
<cfparam name="price" default="">
<cfparam name="bed" default="">
<cfparam name="bath" default="">
<cfparam name="square_feet" default="">
<cfparam name="description" default="">
<cfparam name="movie" default="">
<cfparam name="pic1" default="">
<cfparam name="pic2" default="">
<cfparam name="pic3" default="">
<cfparam name="pic4" default="">
<cfparam name="pic5" default="">
<cfparam name="pic6" default="">
<cfparam name="pic7" default="">
<cfparam name="pic8" default="">
<cfparam name="pic9" default="">
<cfparam name="pic10" default="">
<cfparam name="pic11" default="">
<cfparam name="pic12" default="">
<cfparam name="pic13" default="">
<cfparam name="pic14" default="">
<cfparam name="pic15" default="">
<cfparam name="listing_num" default="">
<cfparam name="Submit" default="Add this Listing">
<cfparam name="FormAction" default="Insert">
<!--- CozyInns Logo Header --->
<p align=center><img src="/images/jv.jpg" align=center>
<!--- End Header --->
<!--- Comments at the top of page --->
<!--- End Comments --->
<!--- Word of the day --->
<!--- End Word Of The Day --->
<!--- Get the total number of logins by Authorized users --->
<!--- Stop Get Logins Code --->
<p><a href="jvdbedit.cfm?Action=New"><font size="+2">Add a new Listing?</font></a><br>
<br>
</p>
<hr width="85%" color="#666633">
<cfoutput>
<form method=POST action=jvdbedit.cfm?Action=#FormAction#>
#listing_num#
<table border=0 cellspacing=5>
<tr>
<td>Listing Type:</td>
<td><input type="text" name=listing_type value="#listing_type#" maxlength=1></td>
</tr>
<tr>
<td>Headline:</td>
<td><input type="text" name=listing_headline value="#listing_headline#"></td>
</tr>
<tr>
<td>Price:</td>
<td>$ <input type="text" name=price value="#price#"></td>
</tr>
<tr>
<td>Bedrooms:</td>
<td><input type="text" name=bed value="#bed#"></td>
</tr>
<tr>
<td>Bathrooms: </td>
<td><input type="text" name=bath value="#bath#" size="2"></td>
</tr>
<tr>
<td>Square Footage:</td>
<td><input type="text" name=square_feet value="#square_feet#" size="5"></td>
</tr>
<tr>
<td>Description of Listing:</td>
<td><textarea name=description value="#description#"></textarea></td>
</tr>
<tr>
<td>Link to Ipix:</td>
<td>[URL unfurl="true"]http://<input[/URL] type="text" name=movie value="#movie#"></td>
</tr>
<tr>
<td>Picture 1:</td>
<td><input type="text" name=pic1 value="#pic1#"></td>
</tr>
<tr>
<td>Picture 2:</td>
<td><input type="text" name=pic2 value="#pic2#"></td>
</tr>
<tr>
<td>Picture 3:</td>
<td><input type="text" name=pic3 value="#pic3#"></td>
</tr>
<tr>
<td>Picture 4:</td>
<td><input type="text" name=pic4 value="#pic4#"></td>
</tr>
<tr>
<td>Picture 5:</td>
<td><input type="text" name=pic5 value="#pic5#"></td>
</tr>
<tr>
<td>Picture 6:</td>
<td><input type="text" name=pic6 value="#pic6#"></td>
</tr>
<tr>
<td>Picture 7:</td>
<td><input type="text" name=pic7 value="#pic7#"></td>
</tr>
<tr>
<td>Picture 8:</td>
<td><input type="text" name=pic8 value="#pic8#"></td>
</tr>
<tr>
<td>Picture 9:</td>
<td><input type="text" name=pic9 value="#pic9#"></td>
</tr>
<tr>
<td>Picture 10:</td>
<td><input type="text" name=pic10 value="#pic10#"></td>
</tr>
<tr>
<td>Picture 11:</td>
<td><input type="text" name=pic11 value="#pic11#"></td>
</tr>
<tr>
<td>Picture 12:</td>
<td><input type="text" name=pic12 value="#pic12#"></td>
</tr>
<tr>
<td>Picture 13:</td>
<td><input type="text" name=pic13 value="#pic13#"></td>
</tr>
<tr>
<td>Picture 14:</td>
<td><input type="text" name=pic14 value="#pic14#"></td>
</tr>
<tr>
<td>Picture 15:</td>
<td><input type="text" name=pic15 value="#pic15#">
<input type="hidden" name="listing_num" value="#listing_num#"></td>
</tr>
<tr>
<td><input type="submit" value="#Submit#"></td>
</tr>
</table>
</form>
</cfoutput>
<cfquery name="get_count" datasource="CozyInns" dbtype="ODBC">
select listing_num
from listings
</cfquery>
<cfoutput><font color="Blue">There are <b>#get_count.recordcount# </b>Listings in you database</font></cfoutput>
<hr width="85%" color="#666633">
<form method=POST action=jvdbedit.cfm?Action=Load>
Enter the Listing Number to edit: <input type="text" name="listing_num" size="5">
<input type="submit" Value="LOAD">
</form>
</body>
</html>
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic