Hi all,
I'm connected to SQL DB in flex and I see the table in RDS Dataview, but when I try to retrieve the data thru cfc it doesn't show any. I checked for the data on server it is there. I don't know wht I'm doing wrong and help is appreciated.
"test.cfc"
Code:
<cfcomponent displayname="test.cfc" hint="CFC controls all things in testReport" output="false">
<cffunction name="getBuyType" access="remote" returnType="query" output="false">
<cfquery name="BuyTypeQRY" datasource="gmpwMaster">
SELECT DISTINCT Buy_Type
FROM dbo.perseus_AdAssignment
WHERE Buy_Type = 'Branding'
OR Buy_Type = 'InMarket'
ORDER BY Buy_Type
</cfquery>
<cfreturn BuyTypeQRY>
</cffunction>
</cfcomponent>
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" x="0" y="0" width="1200" height="766" creationComplete="initGap()">
<mx:Script>
<![CDATA[
import mx.effects.Resize;
import mx.utils.ObjectUtil;
import mx.controls.Alert;
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.controls.dataGridClasses.DataGridColumn;
import mx.core.*;
import mx.managers.PopUpManager;
import mx.containers.TitleWindow;
import mx.core.IUIComponent;
use namespace mx_internal;
[Bindable] public var xmlBuyType:XML;
[Bindable] public var xmlDivision:XML;
private function initGap():void {
cfGap.getBuyType();
cfGap.getDivision();
}
private function saveGap():void {
var BuyType:String;
var Division:String;
if( cbBuyType.selectedItem.toString()=='' || cbDivision.selectedItem.toString()==''){
Alert.show("Buy Type Unvalid Type")
}
else {
BuyType = cbBuyType.selectedItem.toString();
Division = cbDivision.selectedItem.toString();
}
}
public function resultBuyType(event:ResultEvent):void {
xmlBuyType = new XML(event.result);
}
public function resultDivision(event:ResultEvent):void {
xmlDivision = new XML(event.result);
}
]]>
</mx:Script>
<!--Database Server Connection -->
<mx:RemoteObject id="cfGap" destination="ColdFusion" source="TDB.CFCs.test" showBusyCursor="true">
<mx:method name="getBuyType" result="resultBuyType(event)" fault="Alert.show(event.fault.message)"/>
</mx:Canvas>