ColdFusion11 Mobile - Datasource wont work the same for WEB and cfclient

New Here ,
Nov 19, 2015 Nov 19, 2015

Copy link to clipboard

Copied

I have an oracle data source which works fine in a web app but wont work if I write a cfquery inside a cfclient. I would like to know what the problem is or is it a bug.

index.cfm:


   <div id="actual_1"></div>

  <cfclientsettings  enableDeviceAPI = "false"  detectDevice = "false" > 
  <cfclient>
   <cftry>
    <cfinvoke component="querydb" method="getDbdetails" returnvariable="variables.ServerForms"> </cfinvoke>
         <cfset document.getElementById("actual_1").innerHTML+=variables.ServerForms>
    <!---<form action="listcsar.cfm" method="post">

     <input type="submit" value="View my CSAR">    
    </form>--->
    <cfcatch>
     <cfset document.getElementById("actual_1").innerHTML+= cfcatch.message & "<BR>">
    </cfcatch>
    </cftry>
    <cfset document.getElementById("actual_1").innerHTML+="DONE" & "<BR>">

  </cfclient>
 

QueryDB.cfc:

<cfcomponent >

<cffunction name="getDbdetails" access="remote"  returntype="numeric" >

     <cfquery name="tst" datasource="DEVTRY1" result="rr1">

    SELECT count(*) as counts FROM SECURITY.REQS

   </cfquery>

  <cfreturn tst.recordcount>

</cffunction>

</cfcomponent>

Views

149

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 20, 2015 Nov 20, 2015

Copy link to clipboard

Copied

Can you define "Won't work".  Are you getting an error message or something else that you can share?

--Dave

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 20, 2015 Nov 20, 2015

Copy link to clipboard

Copied

LATEST

Dave, I get a error message - Cannot read property 'variables' of null. Its basically unable to connect to the same database.

I Write a query without CFCLIENT for the same DB it works but it fails if I write it inside CFCLIENT.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines