Yes I just did, that worked, but now the update query does not seem to be updating even the values are being set in the Bean, and I can access them using the Get methods. I'm going to look at the Debug and see if the SQL is workign correctly.

Slowly getting there, thanks for the help.

On 22/09/05, RADEMAKERS Tanguy <[EMAIL PROTECTED] > wrote:
just thinking out loud - have you tried
 
<cfargument name="contactDetails" type="Helpdesk_dev.cfc.Beans.ContactDetailsBean" required="true" />
 
 
/t



From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Stephen Adams
Sent: Thursday, September 22, 2005 2:30 PM
To: [email protected]
Subject: [CFCDev] How to find out information about the type of object you are using.

Hi all,

I'm trying to use a DAO component and a Bean to update details submitted by a form. I'm tryng to use the method that Joe Reinhart set out in his blog (http://clearsoftware.net/client/index.cfm?mode=entry&entry=3D1115E7-E081-2BAC-6953DA4394855DDB ) where you use a Bean to gather all the form fields together, then pass the Bean object to DAO object, and the update query.

Unfortunately everytime I pass my Bean to the DAO object I get an error message telling me that it's not an object type of my Bean! Is there anyway I can check, what my Bean object contains and what type it is.

Here's what my code looks like:

contactDetails = createObject("component", "Helpdesk_dev.cfc.Beans.ContactDetailsBean");
contactDetails.SetDRBNumber('#FORM.txtDRBNumber#');
contactDetails.SetDRBName('#FORM.txtDRBName#');
contactDetails.SetAddress1('#FORM.txtAddress1#');
contactDetails.SetAddress2('#FORM.txtAddress2#');
contactDetails.SetAddress3('#FORM.txtAddress3#');
contactDetails.SetAddress4('#FORM.txtTown#');
contactDetails.SetPostcode('#FORM.txtPostcode#');
contactDetails.SetHeadName ('#FORM.txtContactName#');
contactDetails.SetHeadTelNo('#FORM.txtContactTel#');
contactDetails.SetHeadFaxNo('#FORM.txtContactFax#');
contactDetails.SetHeadEmail('#FORM.txtContactEmail#');
           
// pass Bean containing form field details to update method
objContactDetails = createObject("component", "Helpdesk_dev.cfc.DAO.DrbDAO").init(#application.DSN#);   
updatedContactDetails = objContactDetails.update(contactDetails);

Then the update method from the DAO bean looks like this:

<cffunction name="update" access="public" returntype="struct" output="false">
        <cfargument name="contactDetails" type="ContactDetailsBean" required="true" />
       
        <cfquery name="updateContactDetails" datasource="#variables.DSN#">
            UPDATE     tbl_Contact_details
            SET        Address1 = '#contactDetails.GetAddress1()#',
                          Address2 = '#contactDetails.GetAddress2()#',
                          Address3 = '#contactDetails.GetAddress3()#',
                          Address4 = '#contactDetails.GetAddress4()#',
                          PostCode = '#contactDetails.GetPostcode()#',
                          Name_of_head = '#contactDetails.GetHeadName()#',
                          TelNo_of_head = '#contactDetails.GetHeadTelNo()#',
                          FaxNo_of_head = '#contactDetails.GetHeadFaxNo()#',
                          Email_of_head = '#contactDetails.GetHeadEmail()#'
            WHERE    DRB_Number = '#contactDetails.GetDRBNumber()#'
        </cfquery>
       
    </cffunction>

I'm stumped by this?

Stephen
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone ( www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

Reply via email to