Ask a Question related to Coldfusion Database Access, Design and Development.
-
Rick #1
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
-
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... -
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... -
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... -
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... -
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... -
Rick #2
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



Reply With Quote

