  | |  | Pls help me in flash Remoting Server | Pls help me in flash Remoting Server 2004-02-12 - By Sanjay
Back 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><cfcomponent><BR> <cffunction name="doLogin" hint="Verifies user login." returntype="any" access="remote"><BR> < ;cfargument name="myUser" type="numeric" required="true" default="0"><BR> <CFQUERY NAME="loginQuery" DATASOURCE="CompanyInfo"><BR>   ; SELECT * FROM Employee WHERE emp_ID = #flash.emp_ID#<BR> </CFQUERY><BR> <CFreturn loginQuery><BR> </cffunction><BR></cfcomponent><BR><BR><BR >Flash Coding..<BR><BR>#include "NetServices.as"<BR>#include "NetDebug.as"<BR>loginBut._focusrect = false;<BR>loginBut.onRelease = function( ) {<BR> loginProvider();<BR>};<BR>loginListener = new Object();<BR>loginListener.onKeyDown = function() {<BR> if (Key.isDown(13) ) {<BR> loginProvider();<BR> }<BR>};<BR>Key.addListener(loginListener);<BR >function loginProvider() {<BR><BR> if (username.text == "") {<BR> errormessage.text = "Enter Student ID.";<BR> errormessage.textColor = 0xFF0000;<BR> Selection.setFocus(username);<BR> } else if (username.length<2) {<BR> errormessage.text = "You have entered "+username.length+" characters. Your student ID number is 9 digits.";<BR> errormessage.textColor = 0xFF0000;<BR> Selection.setFocus(username);<BR> } else {<BR> var search = new Object();<BR> search.uName = username.text;<BR> myService.doLogin(search.uName);<BR> errormessage.textColor = 0x333333;<BR> errormessage.text = "requesting login...";<BR> }<BR>}<BR>//myService.doLogin();<BR>function doLogin_Result(result) {<BR> usename.text = result.item[0].firstName;<BR> /*if (result.items[0].studentID == username.text) {<BR> errormessage.textColor = 0x000000;<BR> errormessage.text = "Welcome "+result.items[0].firstName;<BR> } else {<BR> errormessage.textColor = 0xFF0000;<BR> errormessage.text = "Login unsuccessful. Please try again.";<BR> Selection.setFocus(username);<BR> }*/<BR>}<BR>function doLogin_Status(error) {<BR> errormessage.textColor = 0xFF0000;<BR> errormessage.text = error.description;<BR>}<BR>if (inited == null) {<BR> inited = true;<BR> NetServices.setDefaultGatewayUrl("<A href="http://localhost/flashservices/gateway">http://localhost/flashservices /gateway</A>");<BR> gateway_conn = NetServices.createGatewayConnection();<BR> 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.
|
|
 |