D
Dave Lagergren
I am using the followign code for logon to a site. I need to add a fiedl
named LVL to define the level of access. I have it defined as text in the
access database. How do I retreive it ? Here is the code I am using in an
..inc file:
' This function checks for a username/password combination.
Function ComparePassword(UID,PWD,LVL)
' Define your variables. LVL is used to set the level of access granted
to a user.
Dim strSQL, objCN, objRS, objLVL
' Set up your SQL string.
strSQL = "SELECT * FROM " & USERS_TABLE & _
" WHERE (UID='" & ParseText(UID) & _
"' AND PWD='" & ParseText(PWD) & "');"
' Create a database connection object.
Set objCN = Server.CreateObject("ADODB.Connection")
' Open the database connection object.
objCN.Open "driver={Microsoft Access Driver (*.mdb)}; dbq=" & _
Server.MapPath(MDB_URL) & "; uid=admin; pwd="
' Run the database query.
Set objRS = objCN.Execute(strSQL)
' Set the status to true/false for the database lookup.
ComparePassword = Not(objRS.EOF)
' Get the access level for this user
' HERE I NEED TO GET THE VALUE FOR LVL AND SET IT TO A SESSION VARIABLE
' Close your database objects.
Set objRS = Nothing
Set objCN = Nothing
End Function
named LVL to define the level of access. I have it defined as text in the
access database. How do I retreive it ? Here is the code I am using in an
..inc file:
' This function checks for a username/password combination.
Function ComparePassword(UID,PWD,LVL)
' Define your variables. LVL is used to set the level of access granted
to a user.
Dim strSQL, objCN, objRS, objLVL
' Set up your SQL string.
strSQL = "SELECT * FROM " & USERS_TABLE & _
" WHERE (UID='" & ParseText(UID) & _
"' AND PWD='" & ParseText(PWD) & "');"
' Create a database connection object.
Set objCN = Server.CreateObject("ADODB.Connection")
' Open the database connection object.
objCN.Open "driver={Microsoft Access Driver (*.mdb)}; dbq=" & _
Server.MapPath(MDB_URL) & "; uid=admin; pwd="
' Run the database query.
Set objRS = objCN.Execute(strSQL)
' Set the status to true/false for the database lookup.
ComparePassword = Not(objRS.EOF)
' Get the access level for this user
' HERE I NEED TO GET THE VALUE FOR LVL AND SET IT TO A SESSION VARIABLE
' Close your database objects.
Set objRS = Nothing
Set objCN = Nothing
End Function