<html>
<head>
<title> Process Login Include Test Page </title>
</head>
<body>
<!-- #include virtual="/includes/dbopen.asp" -->
<%
username = Request.Form("Username"
password = Request.Form("Password"
Response.Write(Username & " " & Password & "<br>"
If username <> "" Then
SQL = "SELECT * FROM employees WHERE username='" & username & "' AND password ='" & password & "'"
End If
set cmdDC = Server.CreateObject("ADODB.Command"
cmdDC.ActiveConnection = Conn
cmdDC.CommandText = SQL
Set RecordSet = Server.CreateObject("ADODB.Recordset"
'-- Cursor Type, Lock Type
'-- ForwardOnly 0 - ReadOnly 1
'-- KeySet 1 - Pessimistic 2
'-- Dynamic 2 - Optimistic 3
'-- Static 3 - BatchOptimistic 4
RecordSet.Open cmdDC, , 0, 2
If Not RecordSet.EOF Then
Response.Write("User has been found!"
empid = RecordSet.Fields("EmployeeID"
empfname = RecordSet.Fields("FirstName"
emplname = RecordSet.Fields("LastName"
' Dim struserLevel
' struserLevel = RecordSet.Fields("userLevel"
' Session("userLevel"
= struserLevel
Session("empid"
= empid
Session("empfname"
= empfname
Session("emplname"
= emplname
Response.Redirect("Else
'The user was not validated...
'Take them to a page which tells them they were not validated...
'Response.Redirect "register.asp"
Response.Write("User has NOT been found!"
Response.Redirect("
End If
Conn.Close
cmdDC.ActiveConnection = Nothing
%>
</body>
</html>
my logon works fine if you put in the correct username and password, and it works great if you put in the wrong username and password, but if you dont put anything at all in the username and try to login it breaks and says there is a error type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E0C)
Command text was not set for the command object.
/processlogin.asp, line 31
<head>
<title> Process Login Include Test Page </title>
</head>
<body>
<!-- #include virtual="/includes/dbopen.asp" -->
<%
username = Request.Form("Username"
password = Request.Form("Password"
Response.Write(Username & " " & Password & "<br>"
If username <> "" Then
SQL = "SELECT * FROM employees WHERE username='" & username & "' AND password ='" & password & "'"
End If
set cmdDC = Server.CreateObject("ADODB.Command"
cmdDC.ActiveConnection = Conn
cmdDC.CommandText = SQL
Set RecordSet = Server.CreateObject("ADODB.Recordset"
'-- Cursor Type, Lock Type
'-- ForwardOnly 0 - ReadOnly 1
'-- KeySet 1 - Pessimistic 2
'-- Dynamic 2 - Optimistic 3
'-- Static 3 - BatchOptimistic 4
RecordSet.Open cmdDC, , 0, 2
If Not RecordSet.EOF Then
Response.Write("User has been found!"
empid = RecordSet.Fields("EmployeeID"
empfname = RecordSet.Fields("FirstName"
emplname = RecordSet.Fields("LastName"
' Dim struserLevel
' struserLevel = RecordSet.Fields("userLevel"
' Session("userLevel"
Session("empid"
Session("empfname"
Session("emplname"
Response.Redirect("Else
'The user was not validated...
'Take them to a page which tells them they were not validated...
'Response.Redirect "register.asp"
Response.Write("User has NOT been found!"
Response.Redirect("
End If
Conn.Close
cmdDC.ActiveConnection = Nothing
%>
</body>
</html>
my logon works fine if you put in the correct username and password, and it works great if you put in the wrong username and password, but if you dont put anything at all in the username and try to login it breaks and says there is a error type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E0C)
Command text was not set for the command object.
/processlogin.asp, line 31