Kelly is right with the cftry and cfcatch.  If you change your query like this 
it should correct your bug I am thinking because when you write a query the 
database field has to be on the left.  TSQL doesnt know what a session variable 
is.

>> <cfquery datasource="#DSN#" name="isStudentEmployee">
>>              SELECT
>>              profileID
>>            FROM
>>              mod_userStatus
>>              WHERE
>>              profileID = #Session.Profile.profileID# 
>>        </cfquery>

I wonder why ColdFusion does that never really knew why.  Perhaps one of the 
senior guys can answer that one.

Thanks,

Mike

On Jan 26, 2011, at 1:12 PM, Kelly wrote:

> 
> Yep this is true - a cftry/cfcatch helps or just run the query outside 
> of the cfc to see if it's throwing an error.
> 
> On 1/26/2011 1:03 PM, Michael Firth wrote:
>> I also want to add when you run a cfc page with a query sometimes when you 
>> get an error a blank page will occur without any error information.
>> 
>> 
>> On Jan 26, 2011, at 12:47 PM, Adam Bourg wrote:
>> 
>>> Here's what I'm trying to do. I'm building a module that only our 
>>> Professional Staff can access, I am trying to identify where the person 
>>> logged in is a pro staff member or a student staffer. When they log into 
>>> our CMS, there is a session variable that returns their profile id. it is: 
>>> #Session.Profile.profileID#
>>> 
>>> We have two tables:
>>> Table 1: pro_profile
>>> Primary key: profileID
>>> This contains all users, their information etc...
>>> 
>>> Table 2: mod_userStatus
>>> Primary key:
>>> Sec Key: profileID
>>> This is simply a primary key with a secondary key of profileID. If a person 
>>> is on this list they are a prostaffer, if not they are a student.
>>> 
>>> I'm trying to query the database and return boolean if the user exists on 
>>> mod_userStatus. If yes, they can access the page, if no, redirect.
>>> 
>>> Here's the CFC.
>>> 
>>>    <cffunction name="isStudentEmployee" returntype="boolean" hint="Method 
>>> to determine if the person logged in is a student or pro staffer, will 
>>> corelate to a control structure if student employee throw up access denied">
>>>     <cfquery datasource="#DSN#" name="isStudentEmployee">
>>>             SELECT
>>>             profileID
>>>            FROM
>>>             mod_userStatus
>>>             WHERE
>>>             #Session.Profile.profileID# = profileID
>>>        </cfquery>
>>> 
>>>      <cfreturn true>
>>>    </cffunction>
>>> 
>>> When I run this, it just gives me a blank page, returns nothing and no 
>>> error.
>>> 
>>> 
>> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341391
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to