Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default cf.query

    I am trying to do some Flash Remoting database query. I can pass a variable
    over to the flash form but not from a query.

    Any one know what I am doing wrong. I know everything. :-)

    Any help would be much appreciated!!!


    Here is my flash form I have pulled from examples so I know there is some
    extra code here.

    It tells me my variable time is not there but I do not know how to declare
    it.

    <cfsavecontent variable="getData">
    <cfoutput>
    //create connection
    var connection:mx.remoting.Connection =
    mx.remoting.NetServices.createGatewayConnection("h ttp://#cgi.HTTP_HOST#/flashservices/gateway/");
    //declare service
    var myService:mx.remoting.NetServiceProxy;
    </cfoutput>

    //put the controls in scope to avoid calling _root
    var mask = mask;
    var display = display;

    //make an object that will handle the response
    var responseHandler = {};

    //function that receives the response
    responseHandler.onResult = function( results: Object ):Void {
    //when results are back, we show the text received
    display.text = results;
    }

    //function that receives any error that may have occurred during the call
    responseHandler.onStatus = function( stat: Object ):Void {
    //if there is any error, show an alert
    alert("Error while calling cfc:" + stat.description);
    }

    //get service. First parameter is path to component and
    //the second it's the object that will handle the response
    myService = connection.getService("flashRemotingResponder",
    responseHandler );
    //make call
    myService.getDate(mask.text);
    </cfsavecontent>


    <cfform name="myform" height="200" width="400" format="Flash" timeout="0" >
    <cfinput type="text" name="display" label="Test" size="20">
    <cfinput type="button" name="Submit" onClick="#getData#" value="Submit">
    </cfform>

    Here is my flashRemotingResponder.cfc

    <cfcomponent name="flashRemotingResponder" access="public"
    description="Responds to Flash remoting requests">

    <!---
    :::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::
    --->
    <cffunction name="getDate" output="false" description="Returns the current
    time"
    access="remote" returntype="string">
    <cfargument name="mask" required="false" type="string" default=""/>


    {
    var result = CF.query("SPAM", "SELECT * from Remails");
    return result;
    }

    <cfoutput query="result" maxrows="1" startrow="1">
    <cfset var time = email />
    </cfoutput>


    <cfreturn time />

    </cffunction>

    </cfcomponent>


    Rick Guest

  2. Similar Questions and Discussions

    1. Query of Queries on query New type query
      In CF5 we have a page that creates a query, using queryNew and querySetCell and the like, we then used dbtype="query" and gave it's name so we could...
    2. query of query throwing weird exception
      One workaround: I had added rows to a cfsearch query, and set a numeric value in custom1 field that that query provides. A query of queries...
    3. Convert a query to a list, or find an item in a query
      Hi All, I am using CFPOP to retrieve mail from a server, then delete each message after I retrieve it. What I want to do is to check that I don;t...
    4. CAML Query: Multiple Query Fields Issue
      I need to Create a CAML Query Dynamically with VB to a Sharepoint WebService GetListItems Method. The User Could Select 1 to X Number of IDs...
    5. BCP query out executed by xp_cmdshell works fine from query analyzer but fails from VB Component
      Hi all, I have a stored procedure which returns a vast number of record and i have to write the output into a csv file. I'm using BCP utility to...
  3. #2

    Default Re: cf.query

    Well I figured out how to use cfquery instead but if anyone know the answer
    to this I would be interested.

    Thanks!!

    "Rick" <rick@di-wave.com> wrote in message
    news:dqshim$7ng$1@forums.macromedia.com...
    >I am trying to do some Flash Remoting database query. I can pass a variable
    >over to the flash form but not from a query.
    >
    > Any one know what I am doing wrong. I know everything. :-)
    >
    > Any help would be much appreciated!!!
    >
    >
    > Here is my flash form I have pulled from examples so I know there is some
    > extra code here.
    >
    > It tells me my variable time is not there but I do not know how to declare
    > it.
    >
    > <cfsavecontent variable="getData">
    > <cfoutput>
    > //create connection
    > var connection:mx.remoting.Connection =
    > mx.remoting.NetServices.createGatewayConnection("h ttp://#cgi.HTTP_HOST#/flashservices/gateway/");
    > //declare service
    > var myService:mx.remoting.NetServiceProxy;
    > </cfoutput>
    >
    > //put the controls in scope to avoid calling _root
    > var mask = mask;
    > var display = display;
    >
    > //make an object that will handle the response
    > var responseHandler = {};
    >
    > //function that receives the response
    > responseHandler.onResult = function( results: Object ):Void {
    > //when results are back, we show the text received
    > display.text = results;
    > }
    >
    > //function that receives any error that may have occurred during the call
    > responseHandler.onStatus = function( stat: Object ):Void {
    > //if there is any error, show an alert
    > alert("Error while calling cfc:" + stat.description);
    > }
    >
    > //get service. First parameter is path to component and
    > //the second it's the object that will handle the response
    > myService = connection.getService("flashRemotingResponder",
    > responseHandler );
    > //make call
    > myService.getDate(mask.text);
    > </cfsavecontent>
    >
    >
    > <cfform name="myform" height="200" width="400" format="Flash" timeout="0"
    > >
    > <cfinput type="text" name="display" label="Test" size="20">
    > <cfinput type="button" name="Submit" onClick="#getData#" value="Submit">
    > </cfform>
    >
    > Here is my flashRemotingResponder.cfc
    >
    > <cfcomponent name="flashRemotingResponder" access="public"
    > description="Responds to Flash remoting requests">
    >
    > <!---
    > :::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::
    > --->
    > <cffunction name="getDate" output="false" description="Returns the current
    > time"
    > access="remote" returntype="string">
    > <cfargument name="mask" required="false" type="string" default=""/>
    >
    >
    > {
    > var result = CF.query("SPAM", "SELECT * from Remails");
    > return result;
    > }
    >
    > <cfoutput query="result" maxrows="1" startrow="1">
    > <cfset var time = email />
    > </cfoutput>
    >
    >
    > <cfreturn time />
    >
    > </cffunction>
    >
    > </cfcomponent>
    >
    >

    Rick Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139