Skip to main content
Participant
August 27, 2008
Question

Connection to database problem

  • August 27, 2008
  • 1 reply
  • 389 views
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">
<cfquery datasource="#application.datasource#" username="#application.datasourceusername#" password="#application.datasourcepassword#" name="getresults">
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:qadmin\questionnaire\results.cfm, line: 220

Apperciate all help. Thanks.
This topic has been closed for replies.

1 reply

Inspiring
August 27, 2008
seems pretty clear what the message says - those variables don't exist in the application scope when you run the code.