I'm getting the following error:
The error occurred in
C:\Inetpub\R3Staging\Htdocs\qadmin\questionnaire\questionnaire.cfc: line 220
218 : <CFFUNCTION NAME="getresults" HINT="get questionnaire results"
ACCESS="Public" RETURNTYPE="query">
219 : <CFARGUMENT NAME="questionnaireid" REQUIRED="yes" TYPE="numeric">
220 : <cfquery datasource="#application.datasource#"
username="#application.datasourceusername#"
password="#application.datasourcepassword#" name="getresults">
221 : select *
222 : from tbl_response
Line seems where the problem is.
Here is the rest of the code
<CFFUNCTION NAME="getresults" HINT="get questionnaire results" ACCESS="Public"
RETURNTYPE="query">
<CFARGUMENT NAME="questionnaireid" REQUIRED="yes" TYPE="numeric">
[b]<cfquery datasource="#application.datasource#"
username="#application.datasourceusername#"
password="#application.datasourcepassword#" name="getresults">[/b]
select *
from tbl_response
where res_qus_id = #arguments.questionnaireid#
order by res_createdby
</cfquery>
<CFRETURN getresults>
</CFFUNCTION>
Here is the log file error:
Element DATASOURCEUSERNAME is undefined in APPLICATION. The specific sequence
of files included or processed is:
C:\Inetpub\R3Staging\Htdocs\qadmin\questionnaire\results.cfm, line: 220
Apperciate all help. Thanks.
SafariTECH - 27 Aug 2008 20:16 GMT
seems pretty clear what the message says - those variables don't exist in the application scope when you run the code.