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
  #1  
Old June 17th, 2004, 03:46 AM
cjsutton cjsutton is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 cjsutton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old June 17th, 2004, 04:05 AM
cjsutton cjsutton is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 cjsutton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #3  
Old June 17th, 2004, 12:05 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,488 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 18 h 10 m 11 sec
Reputation Power: 42
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

Reply With Quote
  #4  
Old June 17th, 2004, 01:15 PM
cjsutton cjsutton is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 3 cjsutton User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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.

Reply With Quote
  #5  
Old June 17th, 2004, 01:41 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,488 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 18 h 10 m 11 sec
Reputation Power: 42
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Action Pages -get error msg


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





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