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:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old April 11th, 2008, 10:47 PM
TheRecruit TheRecruit is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 2 TheRecruit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 40 m 4 sec
Reputation Power: 0
Deleting record on database gives element undefined

Hello!!

HELP!!

Ok, Im newish to coldfusion and have got confused!

I have made a database, where i can view, edit, add new records and its all working fine. I am trying to also have a delete feature on it. I have created the link for it to delete, and added the commands but im getting an error message when i hit delete saying :




"The web site you are accessing has experienced an unexpected error.
Please contact the website administrator.

The following information is meant for the website developer for debugging purposes.

Error Occurred While Processing Request
Element DEPART is undefined in QARTIST.

"


Not sure why its saying 'depart' specfically as that is the 3rd row in the table.

Not too sure on where to go frm here. Could i ask for a bit more specific help?

I have 3 an index page which displays the 7 rows + a link to edit any of the returned data :


<td>#qArtists.CurrentRow#</td>
<td>#qArtists.FirstName#</td>
<td>#qArtists.LastName#</td>
<td>#qArtists.Depart#</td>
<td>#qArtists.Hotel#</td>
<td>#qArtists.Board#</td>
<td>#qArtists.Price#</td>
<td><a href="updateartist.cfm?artistid=#qArtists.ArtistID#">Edit</a></td>



Then i have a :
artist.cfc which i added the delete code to :


<cffunction name="deleteArtist" access="public" returntype="void">
<cfargument name="artistid" type="numeric" required="yes">

<cfquery datasource="#application.datasource#">
DELETE FROM artists
WHERE ArtistID = #arguments.artistid#
</cfquery>

</cffunction>


then i have a delete.cfm file


<cfif IsDefined("form.artistid")>
<cfinvoke
component="cf8essentials.cfc.Artist"
method="deleteArtist">
<cfinvokeargument name="artistid" value="#form.artistid#"/>
</cfinvoke>
<cflocation url="/cf8essentials/artists/index.cfm" addtoken="no">
</cfif>


<cfform>
<cfinput type="submit" name="submit" value="Delete">
<cfinput type="button" name="cancel" value="Cancel"
onclick="history.back()">
<cfinput type="hidden" name="artistid" value="#url.artistid#">
</cfform>


Hope that is a detailed enough explanation of my problem! Any help is greatly appreciaited and if you need me to explain more on what im doing wrong i will try to or i could give more source code.

Thanks very very very very much to anyone who helps in advance!

Reply With Quote
  #2  
Old April 12th, 2008, 10:52 AM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,475 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 17 h 7 m 51 sec
Reputation Power: 42
If you dump the query on your query display page after the delete, do you get anything? Is the query empty? If so you may need a check around the display of the data to ensure that the query has data, i.e.

<cfif qArtists.recordCount>
...output the data....
<cfelse>
No data to show.
</cfif>
__________________
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
  #3  
Old April 12th, 2008, 12:54 PM
TheRecruit TheRecruit is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 2 TheRecruit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 40 m 4 sec
Reputation Power: 0
Unhappy

Quote:
Originally Posted by kiteless
If you dump the query on your query display page after the delete, do you get anything? Is the query empty? If so you may need a check around the display of the data to ensure that the query has data, i.e.

<cfif qArtists.recordCount>
...output the data....
<cfelse>
No data to show.
</cfif>


Hello,

Thanks for the response! I tried as you said and continued to get errors! The data is all in place it seems and ive got no idea why this isnt working! I thought it was my coldfusion setup at one point but other stuff such as add new rows and edit rows is working fine. I have uploaded the files here :

w*w.megaupload.com/?d=ORD1AXEO

Is there any chance you could make sure im not missing something major or why this isnt working? need to get this site done by monday for work and im struggling on it! Looked over these pages so many times and jsut cant see what the problem is..

Reply With Quote
  #4  
Old April 13th, 2008, 07:31 PM
kiteless kiteless is offline
Moderator
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,475 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 17 h 7 m 51 sec
Reputation Power: 42
Yeah, sorry, I'm not going through whatever that site is trying to get me to do just to download your files. If you can post a small part of the code that you think is the source of the error I can have a look, but please don't just post a huge block of code as I don't have time to look through it all.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Deleting record on database gives element undefined


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 2 hosted by Hostway