login Authentification
hi all the pros out there..I have been trying to catch this bug, can any body pls help me!!!!
the error is this :
Error Type:
Microsoft VBScript compilation (0x800A0408)
Invalid character
/MemoMgnt/Login.asp, line 53
If objRs.EOF Then
and the code is as follows:
<%
Dim objConn
Dim strDBID
Dim strDBPass
Dim strDB
Dim strSQL
Dim objRs
Dim strError
Function fixQuotes(strData)
fixQuotes = Replace(strData,"'","''")
End Function
strDB = "MemoMgnt"
strDBID ="sa"
strDBPass ="test"
set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "dsn=" & strDB, strDBID, strDBPass
set objRs = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT PWD,Status FROM UserTable WHERE uid='" &_
Request("UserName") & "'"
objRs.open strSQL,objConn
'Set objRs = objConn.Execute (strSQL)
'//see if there are any records returned
response.write objRs.fields(0)
If objRs.EOF Then
'no username found
strError = "- Invalid username or password<br>" & vbNewLine
Else
'check password
If objRs("PWD")=Request.Form("Password") Then
'username/password valid
'save session data
Session("loggedin") = True
Session("userid") = objRs("UID")
'redirect to members area
Response.Redirect ("MainMgnt.asp")
Response.End
Else
'invalid password
strError = "- Invalid username or password<br>" & vbNewLine
End If
End If
If strError <> "" Then
Response.Write"strError"
End If
'//log out
Session("loggedin")=""
Session("userid")=""
objConn.Close
objRs.Close
Set objConn = Nothing
Set objRs = Nothing
%>
Thanks
|