Hi Stuart
thank you - I have got it to work withthe above. However wonder if you could help me by looking at the undernoted code. My error handling in directing it to an unauthorised user page does not seem to work if their name is not in the database. Also if you type in a name in that is in the database in lower case the error handling works - it is the database as title case ie Joe Bloggs.
Can you see a way that it could accept any case ie block, title or lower.
Thanks for your help.
Linda
<%
'Dimension variables
Dim adoCon 'Database Connection Variable
Dim strCon 'Holds the Database driver and the path and name of the database
Dim rsPassword 'Database Recordset Variable
Dim strAccessDB 'Holds the Access Database Name
Dim strSQL 'Database query sring
Dim strname 'Holds the user name
Dim strpassword 'Holds the user's password
'Initalise the variables from the form
'Get variables from form
email = request.form("email"

strname = request.form("name"
'Check the database to see if user exsits and read in their password from database
'Initialise the strAccessDB variable with the name of the Access Database
strAccessDB = "users"
'Create a connection odject
Set adoCon = Server.CreateObject("ADODB.Connection"
'Database connection info and driver
strCon = "DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=letmein; DBQ=" & Server.MapPath(strAccessDB)
'Set an active connection to the Connection object
adoCon.Open strCon
'Create a recordset object
Set rsPassword = Server.CreateObject("ADODB.Recordset"
'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT * FROM tblUsers WHERE tblUsers.UserID = '" & strname & "'"
'Query the database
rsPassword.Open strSQL, strCon
strpassword = rsPassword("Password"

'stremail = rsPassword("email"
'If the recordset finds a record for the username entered then read in the password for the user
If NOT rsPassword.EOF Then
'Read in the user name for the user from the database
If (Request.Form("name"

) = rsPassword("UserID"

Then
'If the user name is valid then set the session variable to True
Session("blnIsUserGood"

= True
'Close Objects before redirecting
Set adoCon = Nothing
Set strCon = Nothing
Set rsPassword = Nothing
%>
<%
'Send the auto email using ASPemail
Set Mail = Server.CreateObject("Persits.MailSender"
Mail.Host = "mail.corpex.com"
'Mail.Host = "mail.lincscot.co.uk"
Mail.From = "password@lincscot.co.uk"
Mail.FromName = "LINC Scotland"
'Mail.AddAddress request.form("email"

Mail.AddAddress stremail
Mail.AddBCC "linda.clark@lincscot.co.uk"
Mail.AddReplyTo "password@lincscot.co.uk"
Mail.Subject = "Password Reminder"
BodyMsg = "222You requested to be reminded of your password in order to gain access to the members area of our website
This is as detailed below: " + Chr(10) + Chr(10)
BodyMsg = BodyMsg + "Name: " & strname & Chr(10) + Chr(10)
BodyMsg = BodyMsg + "Password: " & strpassword & Chr(10) + Chr(10)
Mail.Body = BodyMsg
On Error Resume Next
Mail.Send
%>
<%
'Redirect to the authorised user page and send the users name
Response.Redirect"password_email_confirmation.htm"
End If
End If
'Close Objects
Set adoCon = Nothing
Set strCon = Nothing
Set rsPassword = Nothing
'If the script is still running then the user must not be authorised
Session("blnIsUserGood"

= False
'Redirect to the unautorised user page
Response.Redirect"unauthorised_password_page.htm"
%>