What is wrong with this function? I am trying to create a
user login that
checks to make sure the user is in the database first, then
check the active
level. If the level is 1 then set sessions and redirect, if 2
then redirect
to the login page and send a URL variable of
account=suspended, if 0 then
redirect to the login page sending a URL variable of
account=inactive, etc.

I want to query the db first to see if the user is in the
datasbase. If yes,
then check the active number. I am getting this error in the
conditional
statement to check the 'active' column.

'You have attempted to dereference a scalar variable of type
class
java.lang.String as a structure with members'

oh, and another thing:
do not have "username" and "password" as arguments. same
names are used for attributes in the <cffunction> tag, and
that can cause problems. rename them to something like "uname" and
"pwd" instead...

re "username" and "password" as function arguments:
you will run into problems if you try to pass any of those
inline inside the <cfinvoke> tag when invoking the cfc that
contains your function. that is, if it is in a cfc...

It's pretty poor practice to use <cflocation> within a
function. You CFM
page should call a method, and get a response back from it.
And then the
CFM page should decide whether to <cflocation> or not.
Possibly your
function should set the URL for the <cflocation> and
return the value.
Then the calling code should use than in a <cflocation>
call.

> <cfelseif login.active EQ 0>

This if/elseif/else construct would be better done as a
switch. Rule of
thumb: evaluating the same variable for many conditions:
switch.
evaluating different variables for many conditions:
if/elseif/else.