|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Action Pages -get error msg
Hi All,
Since I haven't found a free CF hosting site I've been doing development on my PC using CFExpress and PWS. I don't have any other mappings than the original one put on there by CFExpress. I'm developing a Listing, Add, Search, and Update Manager. All is working with the exception of the Action pages. Example:UpdateForm.cfm <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <TITLE>Plant Update Form</TITLE> </HEAD> <BODY> <!--- include selection bar.cfm---> <cfinclude template="Selection Bar.cfm"> <p> <H4>Update Plant Form</H4> </p> <!--- select a plant's information based on the URL passed from the UpdateList page ---> <CFQUERY NAME="GetPlantDetails" DATASOURCE="Piantare"> SELECT PiantaNum, ItemName, CategoryIDPW FROM tblItems WHERE ItemID = #URL.ItemID# </CFQUERY> <!--- query database to get category information to populate dropdown select box ---> <CFQUERY NAME="GetCategories" DATASOURCE="Piantare"> SELECT CategoryID, CategoryName FROM tblCategories </CFQUERY> <!--- build a form so users can enter information about a plant ---> <FORM ACTION="UpdateAction.cfm" METHOD="POST"> <!--- pass the plant id in a hidden field ---> <INPUT TYPE="HIDDEN" NAME="ItemID" VALUE="<cfoutput>#URL.ItemID#</cfoutput>"> <!--- perform server side validation to ensure the user entered a plant name, and a plant number ---> <INPUT TYPE="HIDDEN" NAME="PiantaNum_Required" VALUE="Plant Number is Required!"> <INPUT TYPE="HIDDEN" NAME="ItemName_Required" VALUE="Plant Name is Required!"> <!--- populate text field with Plant number---> <P> Plant Number<BR> <INPUT TYPE="Text" NAME="PiantaNum" SIZE="20" MAXLENGTH="50" VALUE="<cfoutput>#GetPlantDetails.PiantaNum#</cfoutput>"> </P> <!--- populate text field with Plant name---> <P> Plant Name<BR> <INPUT TYPE="Text" NAME="ItemName" SIZE="20" MAXLENGTH="50" VALUE="<cfoutput>#GetPlantDetails.ItemName#</cfoutput>"> </P> <!--- dynamically populate drop down select box with plant category but allow user to to select a another category ---> <P> Category<BR> <SELECT NAME="CategoryID"> <CFOUTPUT QUERY="GetCategories"> <OPTION VALUE="#CategoryID#" <CFIF GetPlantDetails.CategoryIDPW IS GetCategories.CategoryID> SELECTED</CFIF>> #CategoryName# </OPTION> </CFOUTPUT> </SELECT> </P> <br> <input type="Reset" value="Clear Form"> <!--- submit button ---> <p> <INPUT TYPE="Submit" NAME="SubmitButton" VALUE="Update Plant Lists"> </p> <!--- end form ---> </FORM> </BODY> </HTML> When I Select a plant to Update I get this error msg: Error Occurred While Processing Request Error Diagnostic Information Template file not found. HTTP/1.0 404 Object Not Found Note: If you wish to use an absolute template path (e.g. TEMPLATE="/mypath/index.cfm") with CFINCLUDE then you must create a mapping for the path using the ColdFusion Administrator. Using relative paths (e.g. TEMPLATE="index.cfm" or TEMPLATE="../index.cfm") does not require the creation of any special mappings. It is therefore recommended that you use relative paths with CFINCLUDE whenever possible. The error occurred while processing an element with a general identifier of (CFINCLUDE), occupying document position (10:1) to (10:40) in the template file C:\INETPUB\WWWROOT\cfdocs\exampleapp\Piantare\UpdateForm.cfm The specific sequence of files included or processed is: C:\INETPUB\WWWROOT\CFDOCS\EXAMPLEAPP\PIANTARE\UPDATEFORM.CFM . Date/Time: 06/17/04 03:39:01 Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98) Remote Address: 127.0.0.1 HTTP Referer: URL Template: C:\INETPUB\WWWROOT\cfdocs\exampleapp\Piantare\UpdateForm.cfm Query String: ItemID=PW1002-1526 The action page is UpdateAction.cfm <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <TITLE>Update Plant Form Page</TITLE> </HEAD> <BODY> <!--- <cfupdate datasource="Piantare" tablename="tblItems"> ---> <!--- update the plant record in the tblItems plant table ---> <CFQUERY NAME="UpdatePlant" DATASOURCE="Piantare"> UPDATE tblItems SET PiantaNum = '#Form.PiantaNum#', ItemName = '#Form.ItemName#', CategoryIDPW = '#Form.CategoryIDPW#', WHERE ItemID = '#Form.ItemID#' </CFQUERY> <!--- redirect the user to PlantList.cfm ---> <CFLOCATION URL="PlantList.cfm" ADDTOKEN="NO"> </BODY> </HTML> What am I doing wrong? All the cfm files are in the Piantare directory. Thanks so very much! Cathy S. |
|
#2
|
|||
|
|||
|
Action pages-error messages
Hi All,
Correction: UpdatePlantList.cfm=> UpdateForm.cfm =>UpdateAction.cfm Here is the UpdatePlantList.cfm code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <TITLE>Plant Update List</TITLE> </HEAD> <BODY> <!--- include selection bar.cfm---> <cfinclude template="SelectionBar.cfm"> <p> <H4>Plant Update Listing</H4> </p> <!--- query the tblItems table to get a list of all existing plants ---> <CFQUERY NAME="GetPlants" DATASOURCE="Piantare"> SELECT PiantaNum, ItemName, ItemID FROM tblItems </CFQUERY> <!--- heading for the page ---> <p> <H4>Select a Plant to Update</H4> </p> <!--- create anchors that allow users to select the plant they would like to update ---> <CFOUTPUT QUERY="GetPlants"> <A HREF="UpdateForm.cfm?ItemID=#GetPlants.ItemID#">#GetPlants.PiantaNum# #GetPlants.ItemName#</A><BR> </CFOUTPUT> </BODY> </HTML> It chokes on UpdateForm.cfm. It never gets to UpdateAction.cfm. In addition, all two other links Add and Search do find their first Form cfm page, but choke when trying to reach their respective action pages. Why is that and what I do to make this manager work? As it is I can "see" through the CF and SQL the access database just fine, but because the action pages don't come up, I'm unable to add to or update the database. Thanks for all your help!! Cathy S. |
|
#3
|
|||
|
|||
|
According to the error messgae, this is where it is failing in the updateform.cfm file:
<!--- include selection bar.cfm---> <cfinclude template="Selection Bar.cfm"> First, I'd recommend against using a file name with a space in it like that, as it is definitely not cross-platform capable. See if it works if you rename it to selection_bar.cfm or something similar. I'm unfamiliar with CF Express so this could also be a bug/limitation of that version (OLD version) of ColdFusion.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#4
|
|||
|
|||
|
error messages-
Wow! That was the only cfinclude file that had a space in it.
No, the correct filename is SelectionBar.cfm. Now i get this error for the UpdateForm.cfm: Error Occurred While Processing Request Error Diagnostic Information ODBC Error Code = 07001 (Wrong number of parameters) [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. Hint: The cause of this error is usually that your query contains a reference to a field which does not exist. You should verify that the fields included in your query exist and that you have specified their names correctly. The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (15:1) to (15:54) in the template file C:\INETPUB\WWWROOT\CFDOCS\EXAMPLEAPP\PIANTARE\UPDATEFORM.CFM The specific sequence of files included or processed is: C:\INETPUB\WWWROOT\CFDOCS\EXAMPLEAPP\PIANTARE\UPDATEFORM.CFM . Date/Time: 06/17/04 13:11:19 Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98) Remote Address: 127.0.0.1 HTTP Referer: URL Template: C:\INETPUB\WWWROOT\cfdocs\exampleapp\Piantare\UpdateForm.cfm Query String: ItemID=PW1000-1526 In addition, my PlantList.cfm page appears just fine, but when I click on Back to Home it gives me this error message. The PiantareWholesaleApp is again in the Piantare directory as are all the cfm pages. I even get this correct url when the below error appears: URL Error message: Error Occurred While Processing Request Error Diagnostic Information An error has occurred. HTTP/1.0 404 Object Not Found Here is the code for PlantList.cfm: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <TITLE>Piantare Plant Listing </TITLE> </HEAD> <BODY> <!--- include selection bar.cfm---> <cfinclude template="SelectionBar.cfm"> <!--- query the Piantare database to retrieve plant information. ---> <CFQUERY NAME="ListPlants" DATASOURCE="Piantare"> SELECT PiantaNum, ItemName FROM tblItems </CFQUERY> <!--- display page heading ---> <p> <FONT SIZE="+1">Plants Selected </FONT> <A HREF="PiantareWholesaleApplication.cfm"><FONT SIZE="+1">Back to Home</FONT></A> </p> <!--- display the query result set as a table with the appropriate headings ---> <TABLE WIDTH="95%"> <TR> <TH ALIGN="LEFT">Item Number</TH> <TH ALIGN="LEFT">Plant Name</TH> </TR> <CFOUTPUT QUERY="ListPlants"> <TR> <TD>#PiantaNum#</TD> <TD>#ItemName#</TD> </TR> </CFOUTPUT> </TABLE> </BODY> </HTML> Thanks again, Cathy S. |
|
#5
|
|||
|
|||
|
It's impossible for me to diagnose the problem with your links/locations failing. All I can do is say make sure they are all in the same directory and that your URLs and CFLOCATIONS all point to the correct file names. The bottom line is that all of this DOES work just fine (I write CF apps for a living so I am 100% sure this kind of behavior works), so unless CFExpress has a bug in it, the problem *must* be in your code.
Regarding the error, now it is complaining about this: <CFQUERY NAME="GetPlantDetails" DATASOURCE="Piantare"> SELECT PiantaNum, ItemName, CategoryIDPW FROM tblItems WHERE ItemID = #URL.ItemID# </CFQUERY> Confirm that your database has all those fields, that they are spelled correctly, and that ItemID is a numeric field and not a varchar or character field. If you keep having troubles, you should probably get yourself a good book on CF and go through it, it will probably give you answers much more easily than trying to ask in this forum. Last edited by kiteless : June 17th, 2004 at 01:43 PM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Action Pages -get error msg |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|