R
Rich Palarea
I've managed to create a "secure" (what is secure these days!?)
application - nothing more than an Access database of user IDs, passwords
and some profile data for each user.
I can login with a form that I've created. It uses the following script to
ensure a match of username and password:
' This function checks for a username/password combination.
Function ComparePassword(UID,PWD)
' Define your variables.
Dim strSQL, objCN, objRS
' Set up your SQL string.
strSQL = "SELECT * FROM " & USERS_TABLE & " WHERE (UID='" & UID & "' AND
PWD='" & 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)
' Close your database objects.
Set objRS = Nothing
Set objCN = Nothing
End Function
But the main part of the app is using the Database Interface Wizard. I have
the edit.asp page that the DIW creates and I want to pass in the UID for
this session so that the record that comes back for editing belongs to the
logged in user.
How is this done (or is there an easier way than how I'm doing it)? The code
referenced above is contained in an include file that I can place in the
header of a page to redirect if not logged in with a valid account.
Thanks,
Rich
application - nothing more than an Access database of user IDs, passwords
and some profile data for each user.
I can login with a form that I've created. It uses the following script to
ensure a match of username and password:
' This function checks for a username/password combination.
Function ComparePassword(UID,PWD)
' Define your variables.
Dim strSQL, objCN, objRS
' Set up your SQL string.
strSQL = "SELECT * FROM " & USERS_TABLE & " WHERE (UID='" & UID & "' AND
PWD='" & 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)
' Close your database objects.
Set objRS = Nothing
Set objCN = Nothing
End Function
But the main part of the app is using the Database Interface Wizard. I have
the edit.asp page that the DIW creates and I want to pass in the UID for
this session so that the record that comes back for editing belongs to the
logged in user.
How is this done (or is there an easier way than how I'm doing it)? The code
referenced above is contained in an include file that I can place in the
header of a page to redirect if not logged in with a valid account.
Thanks,
Rich