Mailing List
Home
Forum Home
Flash Pro
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Pls help me in flash Remoting Server

Pls help me in flash Remoting Server

2004-02-12       - By Sanjay

 Back
Reply:     1     2     3  

Hi Frds..

Frds i am facing a problem while connecting flash to Coldfusion via flash
remoting server....

the problem is when i enter the value in text box and submit it.. It shows the
following problem :

Service threw an exception during method invocation: Error Executing Database
Query.

Pls help me ,..

Thanks in Advance

Sanjay Sharma

The code is as pasted below:

Coldfusion Coding

<cfcomponent>
 <cffunction name="doLogin" hint="Verifies user login." returntype="any"
access="remote">
       <cfargument name="myUser" type="numeric" required="true" default="0">
       <CFQUERY NAME="loginQuery" DATASOURCE="CompanyInfo">
           SELECT * FROM Employee WHERE emp_ID = #flash.emp_ID#
       </CFQUERY>
       <CFreturn loginQuery>
</cffunction>
</cfcomponent>


Flash Coding..

#include "NetServices.as"
#include "NetDebug.as"
loginBut._focusrect = false;
loginBut.onRelease = function() {
loginProvider();
};
loginListener = new Object();
loginListener.onKeyDown = function() {
if (Key.isDown(13)) {
 loginProvider();
}
};
Key.addListener(loginListener);
function loginProvider() {

if (username.text == "") {
 errormessage.text = "Enter Student ID.";
 errormessage.textColor = 0xFF0000;
 Selection.setFocus(username);
} else if (username.length<2) {
 errormessage.text = "You have entered "+username.length+" characters. Your
student ID number is 9 digits.";
 errormessage.textColor = 0xFF0000;
 Selection.setFocus(username);
} else {
 var search = new Object();
 search.uName = username.text;
 myService.doLogin(search.uName);
 errormessage.textColor = 0x333333;
 errormessage.text = "requesting login...";
}
}
//myService.doLogin();
function doLogin_Result(result) {
usename.text = result.item[0].firstName;
/*if (result.items[0].studentID == username.text) {
 errormessage.textColor = 0x000000;
 errormessage.text = "Welcome "+result.items[0].firstName;
} else {
 errormessage.textColor = 0xFF0000;
 errormessage.text = "Login unsuccessful. Please try again.";
 Selection.setFocus(username);
}*/
}
function doLogin_Status(error) {
errormessage.textColor = 0xFF0000;
errormessage.text = error.description;
}
if (inited == null) {
inited = true;
NetServices.setDefaultGatewayUrl("http://localhost/flashservices/gateway");
gateway_conn = NetServices.createGatewayConnection();
myService = gateway_conn.getService("fRLogin.dataControl", this);
}
Selection.setFocus(username);
errormessage.text = "Enter Student ID below.";
stop();


Pls help me ,..

Thanks in Advance

Sanjay Sharma
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1276" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>Hi Frds..<BR><BR>Frds i am facing a problem while connecting flash to
Coldfusion via flash remoting server....<BR><BR>the problem is when i enter the
value in text box and submit it.. It shows the following problem :
<BR><BR>Service threw an exception during method invocation: Error Executing
Database Query.<BR><BR>Pls help me ,..<BR><BR>Thanks in Advance<BR><BR>Sanjay
Sharma<BR><BR>The code is as pasted below:<BR><BR>Coldfusion
Coding<BR><BR>&lt;cfcomponent&gt;<BR>&nbsp; &lt;cffunction name="doLogin"
hint="Verifies user login." returntype="any"
access="remote"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt
;cfargument
name="myUser" type="numeric" required="true"
default="0"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;CFQUERY
NAME="loginQuery"
DATASOURCE="CompanyInfo"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;
SELECT * FROM Employee WHERE emp_ID =
#flash.emp_ID#<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/CFQUERY&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;CFreturn
loginQuery&gt;<BR>&nbsp;&lt;/cffunction&gt;<BR>&lt;/cfcomponent&gt;<BR><BR><BR
>Flash
Coding..<BR><BR>#include "NetServices.as"<BR>#include
"NetDebug.as"<BR>loginBut._focusrect = false;<BR>loginBut.onRelease = function(
)
{<BR>&nbsp;loginProvider();<BR>};<BR>loginListener = new
Object();<BR>loginListener.onKeyDown = function() {<BR>&nbsp;if (Key.isDown(13)
)
{<BR>&nbsp;
loginProvider();<BR>&nbsp;}<BR>};<BR>Key.addListener(loginListener);<BR
>function
loginProvider() {<BR><BR>&nbsp;if (username.text == "") {<BR>&nbsp;
errormessage.text = "Enter Student ID.";<BR>&nbsp; errormessage.textColor =
0xFF0000;<BR>&nbsp; Selection.setFocus(username);<BR>&nbsp;} else if
(username.length&lt;2) {<BR>&nbsp; errormessage.text = "You have entered
"+username.length+" characters. Your student ID number is 9 digits.";<BR>&nbsp;
errormessage.textColor = 0xFF0000;<BR>&nbsp;
Selection.setFocus(username);<BR>&nbsp;} else {<BR>&nbsp; var search = new
Object();<BR>&nbsp; search.uName = username.text;<BR>&nbsp;
myService.doLogin(search.uName);<BR>&nbsp; errormessage.textColor =
0x333333;<BR>&nbsp; errormessage.text = "requesting
login...";<BR>&nbsp;}<BR>}<BR>//myService.doLogin();<BR>function
doLogin_Result(result) {<BR>&nbsp;usename.text =
result.item[0].firstName;<BR>&nbsp;/*if (result.items[0].studentID ==
username.text) {<BR>&nbsp; errormessage.textColor = 0x000000;<BR>&nbsp;
errormessage.text = "Welcome "+result.items[0].firstName;<BR>&nbsp;} else
{<BR>&nbsp; errormessage.textColor = 0xFF0000;<BR>&nbsp; errormessage.text =
"Login unsuccessful. Please try again.";<BR>&nbsp;
Selection.setFocus(username);<BR>&nbsp;}*/<BR>}<BR>function
doLogin_Status(error) {<BR>&nbsp;errormessage.textColor =
0xFF0000;<BR>&nbsp;errormessage.text = error.description;<BR>}<BR>if (inited ==
null) {<BR>&nbsp;inited = true;<BR>&nbsp;NetServices.setDefaultGatewayUrl("<A
href="http://localhost/flashservices/gateway">http://localhost/flashservices
/gateway</A>");<BR>&nbsp;gateway_conn
= NetServices.createGatewayConnection();<BR>&nbsp;myService =
gateway_conn.getService("fRLogin.dataControl",
this);<BR>}<BR>Selection.setFocus(username);<BR>errormessage.text = "Enter
Student ID below.";<BR>stop();<BR><BR><BR>Pls help me ,..<BR><BR>Thanks in
Advance<BR><BR>Sanjay Sharma</DIV></BODY></HTML>

Earn $52 per hosting referral at Lunarpages.