<%
Dim strBadLogin
strBadLogin = ""
If Request.Form("username") <> "" Then
Dim strPath
strPath = Server.MapPath("login.xls")
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strPath & ";Extended Properties=Excel 8.0"
objConn.Open
Set rsSQL = Server.CreateObject("ADODB.Recordset")
rsSQL.Open "select top 1 * from [Sheet1$] where RTRIM(username) = '" & TRIM(Request.Form("username")) & "' AND RTRIM(password) = '" & TRIM(Request.Form("password")) & "'", objConn
If NOT rsSQL.EOF Then
Response.Cookies("james_creek")("LoggedIn") = "Yes"
Response.Redirect("contact_list.asp")
Response.End()
Else
strBadLogin = "Incorrect log-in. Please try again."
End If
End If
%>