I am having an issue with using a query inside a component:
I am passing two variables to a component; user name and
password, the query returns the username, useraccess and staff id.
When I invoke the component I want to check for a record and allow
or deny access acordingly.
my issues, I am being forced to use a returntype of string or
any. it won't take query.
I get an error everytime I try to use recordcount.
Recordcount is not defined in...
<cfcomponent>
<cffunction name="mylogin" access="public"
returntype="string" >
<cfargument name="UserName" type="string"
required="yes">
<cfargument name="Password" type="string"
required="yes">
<cfset var login="">
<cfquery datasource="TimeReporting" name="login"
result="result">
SELECT UserName,UserPassword,UserAccess,staffID
FROM tblStaff WHERE UserName='#Arguments.UserName#'
AND UserPassword='#Arguments.Password#'
</cfquery>
<cfreturn mylogin>
</cffunction>
</cfcomponent>
here is the error message:
The following information is meant for the website developer
for debugging purposes.
Error Occurred While Processing Request
Element RECORDCOUNT is undefined in MYLOGINRET.
ColdFusion cannot determine the line of the template that
caused this error. This is often caused by an error in the
exception handling subsystem.
Resources:
* Check the ColdFusion documentation to verify that you are
using the correct syntax.
* Search the Knowledge Base to find a solution to your
problem.
Browser Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US;
rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
Remote Address ::1
Referrer
http://localhost/jays_dev/TMR/login.cfm
Date/Time 25-Mar-08 03:57 PM
Stack Trace
at
cfaccess2d12ecfm319416303.runPage(C:\inetpub\wwwroot\jays_dev\TMR\access-1.cfm:44)