I am trying to create a login mechanisim that checks access levels. I am using
the login user server behavior HOWEVER the Access levels are in a different
table and so I cant access it from the server behavior window so I have to edit
the code. When the access levels are in the same table as the rest of the data
all works well. when the access levels are in a different table my code doesnt
work......why. Why code below works for one of the access levels and not the
other, mind you it is getting the info out of another table. Is this a major
FLUKE/default way of working or is it something else. My access levels are '1'
and '2'. 2 can access 1 but 1 cannot access 2. my code is below: Login User
Code <% ' *** Validate request to log in to this site. MM_LoginAction =
Request.ServerVariables('URL') If Request.QueryString<>'' Then MM_LoginAction =
MM_LoginAction + '?' + Server.HTMLEncode(Request.QueryString)
MM_valUsername=CStr(Request.Form('username')) If MM_valUsername <> '' Then
MM_fldUserAuthorization='AccessLvl' MM_redirectLoginSuccess='../login_s.htm'
MM_redirectLoginFailed='../login_f.htm' MM_flag='ADODB.Recordset' set MM_rsUser
= Server.CreateObject(MM_flag) MM_rsUser.ActiveConnection = MM_connDANSW_STRING
MM_rsUser.Source = 'SELECT dbo.tbMembers.MemberId, dbo.tbMembers.MemberPass,
dbo.tbMembers.email, dbo.tbMemberAccessLvl.AccessLvl' If
MM_fldUserAuthorization <> '' Then MM_rsUser.Source = MM_rsUser.Source &amp;
',' &amp; MM_fldUserAuthorization MM_rsUser.Source = MM_rsUser.Source &amp; '
FROM dbo.tbMembers, dbo.tbMemberAccessLvl WHERE dbo.tbMembers.MemberId='' &amp;
Replace(MM_valUsername,''','''') &amp;'' OR dbo.tbMembers.email='' &amp;
Replace(MM_valUsername,''','''') &amp;'' AND dbo.tbMembers.MemberPass='' &amp;
Replace(Request.Form('password'),''','''') &amp; ''' MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2 MM_rsUser.LockType = 3 MM_rsUser.Open If Not
MM_rsUser.EOF Or Not MM_rsUser.BOF Then ' username and password match - this
is a valid user Session('MM_Username') = MM_valUsername If
(MM_fldUserAuthorization <> '') Then Session('MM_UserAuthorization') =
CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization ).Value) Else
Session('MM_UserAuthorization') = '' End If if
CStr(Request.QueryString('accessdenied')) <> '' And true Then
MM_redirectLoginSuccess = Request.QueryString('accessdenied') End If
MM_rsUser.Close Response.Redirect(MM_redirectLoginSuccess) End If
MM_rsUser.Close Response.Redirect(MM_redirectLoginFailed) End If %>