bobbyrabbit
Technical User
I'm now receiving this error:
Microsoft VBScript runtime error '800a01a8'
Object required: ''
login.asp, line 9
Worked fine with Access. Can somebody help me tidy up my code. login.asp below. Many thanks......................
<%@ language = "VBScript"%>
<% Option Explicit %>
<!--#include file="connection.asp"-->
<%
If Request.Form("login") = "Login" then
Dim v_login_name,v_login_password 'variables to capture username and password
v_login_name = Trim(Request.Form("username"))
v_login_password = Trim(Request.Form("password"))
Con.Open connect_string
Rec.CursorType = 1
Rec.CursorLocation = 2
Rec.LockType = 3
Rec.ActiveConnection= Con
Qry = "SELECT * FROM Login " &_
"WHERE LoginUserName='"&v_login_name &"' "
Rec.Open Qry
If Rec.EOF then
Response.Redirect "login.asp?user=invalid"
Else
Dim compare
compare=StrComp(v_login_password,Rec("LoginPassword"))
If compare <> 0 then
Response.Redirect "login.asp?user=invalid"
ElsEif Rec("UserAuthLevel") = 0 then
Response.Redirect "login.asp?user=inactive"
Else
session("s_user") = Trim(Rec("UserFirstName"))&" "&Trim(Rec("UserLastName"))
session("s_AuthLevel") = Rec("UserAuthLevel")
session("s_branchid") = Rec("UserBranchID")
session("s_userid") = Rec("UserId")
Response.Redirect "default.asp"
End If
End If
Rec.Close
Con.Close
Set Rec = Nothing
Set Con = Nothing
End If
%>
Microsoft VBScript runtime error '800a01a8'
Object required: ''
login.asp, line 9
Worked fine with Access. Can somebody help me tidy up my code. login.asp below. Many thanks......................
<%@ language = "VBScript"%>
<% Option Explicit %>
<!--#include file="connection.asp"-->
<%
If Request.Form("login") = "Login" then
Dim v_login_name,v_login_password 'variables to capture username and password
v_login_name = Trim(Request.Form("username"))
v_login_password = Trim(Request.Form("password"))
Con.Open connect_string
Rec.CursorType = 1
Rec.CursorLocation = 2
Rec.LockType = 3
Rec.ActiveConnection= Con
Qry = "SELECT * FROM Login " &_
"WHERE LoginUserName='"&v_login_name &"' "
Rec.Open Qry
If Rec.EOF then
Response.Redirect "login.asp?user=invalid"
Else
Dim compare
compare=StrComp(v_login_password,Rec("LoginPassword"))
If compare <> 0 then
Response.Redirect "login.asp?user=invalid"
ElsEif Rec("UserAuthLevel") = 0 then
Response.Redirect "login.asp?user=inactive"
Else
session("s_user") = Trim(Rec("UserFirstName"))&" "&Trim(Rec("UserLastName"))
session("s_AuthLevel") = Rec("UserAuthLevel")
session("s_branchid") = Rec("UserBranchID")
session("s_userid") = Rec("UserId")
Response.Redirect "default.asp"
End If
End If
Rec.Close
Con.Close
Set Rec = Nothing
Set Con = Nothing
End If
%>