SELECT firstName, lastName FROM tblUser #rsUsers.firstName# #rsUsers.lastName#
Any help is appreciated. [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Stealth [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> SELECT firstName, lastName FROM tblUser #rsUsers.firstName# #rsUsers.lastName#
Any help is appreciated. [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => Dan [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 2 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> SELECT firstName, lastName FROM tblUser [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => BKBK [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 8 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> CFC Query result problem - Coldfusion - Advanced Techniques

CFC Query result problem - Coldfusion - Advanced Techniques

I am new to CFC's. Another function returning the current time works fine, but when I try to get query results, I get the following message: ColdFusion cannot determine how to process the tag <CFINVOKE>. The tag name may be misspelled. I have carefully checked every letter of every word, but have not been able to come up with a solution. Code follows: <cfcomponent hint="Queries related to users in EMTP database" displayname="MyEMTPComponents"> <cffunction name="myUserQ" access="public" returntype="query" hint="Lists users"> <!---<cfargument name="cUserID" type="numeric" required="no">---> <cfquery name="rsUsers" datasource="#ds#"> SELECT firstName, lastName FROM tblUser <!---<cfif isDefined("ARGUMENTS.cUserID")> WHERE userID = #ARGUMENTS.cUserID# </cfif>---> </cfquery> <cfreturn rsUsers> ...

Sponsored Links
  1. #1

    Default CFC Query result problem

    I am new to CFC's. Another function returning the current time works fine, but
    when I try to get query results, I get the following message: ColdFusion cannot
    determine how to process the tag <CFINVOKE>. The tag name may be misspelled.

    I have carefully checked every letter of every word, but have not been able to
    come up with a solution. Code follows:

    <cfcomponent hint="Queries related to users in EMTP database"
    displayname="MyEMTPComponents">
    <cffunction name="myUserQ" access="public" returntype="query" hint="Lists
    users">
    <!---<cfargument name="cUserID" type="numeric" required="no">--->
    <cfquery name="rsUsers" datasource="#ds#">
    SELECT firstName, lastName FROM tblUser
    <!---<cfif isDefined("ARGUMENTS.cUserID")>
    WHERE userID = #ARGUMENTS.cUserID#
    </cfif>--->
    </cfquery>
    <cfreturn rsUsers>
    </cffunction>
    <cffunction name="getLocalTime" access="public">
    <cfreturn TimeFormat(now())>
    </cffunction>
    </cfcomponent>

    <cfinvoke
    component="users"
    method="myUserQ"
    returnvariable="rsUsers">
    </cfinvoke>
    <cfoutput query="rsUsers">#rsUsers.firstName# #rsUsers.lastName#<br></cfoutput>

    Any help is appreciated.



    Sponsored Links
    Stealth Guest

  2. #2

    Default Re: CFC Query result problem

    I notice you have your datasource as a variable. How does your component know
    the value of that variable?

    Originally posted by: Stealth 7
    I am new to CFC's. Another function returning the current time works fine, but
    when I try to get query results, I get the following message: ColdFusion cannot
    determine how to process the tag <CFINVOKE>. The tag name may be misspelled.

    I have carefully checked every letter of every word, but have not been able to
    come up with a solution. Code follows:

    <cfcomponent hint="Queries related to users in EMTP database"
    displayname="MyEMTPComponents">
    <cffunction name="myUserQ" access="public" returntype="query" hint="Lists
    users">
    <!---<cfargument name="cUserID" type="numeric" required="no">--->
    <cfquery name="rsUsers" datasource="#ds#">
    SELECT firstName, lastName FROM tblUser
    <!---<cfif isDefined("ARGUMENTS.cUserID")>
    WHERE userID = #ARGUMENTS.cUserID#
    </cfif>--->
    </cfquery>
    <cfreturn rsUsers>
    </cffunction>
    <cffunction name="getLocalTime" access="public">
    <cfreturn TimeFormat(now())>
    </cffunction>
    </cfcomponent>

    <cfinvoke
    component="users"
    method="myUserQ"
    returnvariable="rsUsers">
    </cfinvoke>
    <cfoutput query="rsUsers">#rsUsers.firstName# #rsUsers.lastName#<br></cfoutput>

    Any help is appreciated.





    Dan Guest

  3. #3

    Default Re: CFC Query result problem

    The datasource is set in application.cfm, in a parent directory to components folder. Just for kicks, I hardcoded the datasource and tried it...same error.
    Stealth Guest

  4. #4

    Default Re: CFC Query result problem

    Stealth 7,

    It worked fine for me with MX7, if I hardcoded the datasource. However, you
    should "var" the local variables used in your function.

    <cfset var rsUsers = "">
    <cfquery name="rsUsers" datasource="yourDSN">
    .... etc ....


    Just for grins, try clearing the template cache and use a different name for
    the returnvariable query.

    mxstu Guest

  5. #5

    Default Re: CFC Query result problem

    MXSTU, I instantiated the variable, cleared cache, didn't work. Scratching my head again.
    Stealth Guest

  6. #6

    Default Re: CFC Query result problem

    Stealth 7,

    Is what you posted the exact code you used (ie. does the component contain
    other code that you did not post)? Where is the CFC located in relation to the
    page calling invoke? What version of MX are you using?

    mxstu Guest

  7. #7

    Default Re: CFC Query result problem

    Since nothing else seems to be working, try this:
    <cfobject name="abc" component="users" />
    <cfscript>
    test1=abc.GetLocalTime();
    test2=abc.myUserQ();
    </cfscript>
    <cfdump var="#test1#">
    <cfdump var="#test2#">


    Originally posted by: Stealth 7
    MXSTU, I instantiated the variable, cleared cache, didn't work. Scratching my
    head again.



    Dan Guest

  8. #8

    Default Re: CFC Query result problem

    I have carefully checked every letter of every word, but have not been able to
    come up with a solution.

    You seem to invoke the component from within the component itself. That's
    problematic. Do something like this instead, using 2 separate files

    invoker.cfm
    ==========
    <cfinvoke
    component="users"
    method="myUserQ"
    returnvariable="rsUsers">
    </cfinvoke>
    <cfoutput query="rsUsers">#rsUsers.firstName# #rsUsers.lastName#<br></cfoutput>

    <cfinvoke
    component="users"
    method="getlocaltime"
    returnvariable="time">
    </cfinvoke>
    <br>time: <cfoutput>#time#</cfoutput>


    users.cfc
    ========
    <cfcomponent hint="Queries related to users in EMTP database"
    displayname="MyEMTPComponents">
    <cffunction name="myUserQ" access="public" returntype="query" hint="Lists
    users">
    <!---<cfargument name="cUserID" type="numeric" required="no">--->
    <cfquery name="rsUsers" datasource="#ds#">
    SELECT firstName, lastName FROM tblUser
    <!---<cfif isDefined("ARGUMENTS.cUserID")>
    WHERE userID = #ARGUMENTS.cUserID#
    </cfif>--->
    </cfquery>
    <cfreturn rsUsers>
    </cffunction>

    <cffunction name="getLocalTime" access="public" [b]returntype="date" >
    <cfreturn TimeFormat(now())>
    </cffunction>
    </cfcomponent>




    BKBK Guest

  9. #9

    Default Re: CFC Query result problem

    I am embarrased to say that I was running into a MX version issue. I upgraded (at host) to MX 7 and the recordset returned fine. THANK YOU very much for your efforts.
    Stealth Guest

  10. #10

    Default Re: CFC Query result problem

    Stealth 7,

    Unfortunately, I think we've all had that experience ;-) Thanks for the follow-up.
    mxstu Guest

Similar Threads

  1. Query best n result
    By alemare in forum MySQL
    Replies: 2
    Last Post: April 4th, 08:37 PM
  2. Format query result.
    By Kasper K in forum MySQL
    Replies: 2
    Last Post: June 29th, 02:19 PM
  3. displaying query result of 0 as N/A
    By eggwater in forum Macromedia ColdFusion
    Replies: 3
    Last Post: May 10th, 11:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •