|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Either BOF or EOF is True, or the current record has been deleted. Requested operatio
There is data in the table and the following script should show "Incorrect login information. Please re-enter." but instead it's redirecting to "newuser.asp"...please respond to URL
DIM v_id DIM v_passwd DIM objConn DIM oRs v_id = trim(Request.Form("v_user_id")) v_passwd = trim(Request.Form("v_password")) ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("alumni.mdb") SET objConn = SERVER.CREATEOBJECT("ADODB.Connection") SET oRs = SERVER.CREATEOBJECT("ADODB.RecordSet") objConn.OPEN ConnectString oRs.Open "SELECT EmailAddress, AlumPassword from tblAlumni " & _ "WHERE EmailAddress='" & trim(v_id) & "'", ConnectString IF not oRs.EOF THEN IF v_id <> trim(oRs("EmailAddress")) or v_passwd <> trim(oRs("AlumPassword")) THEN Response.Cookies("v_login_msg") = "Incorrect login information. Please re-enter." Response.Redirect "login.asp" ELSE Session("sess_id") = trim(v_id) Response.Redirect "editinfo.asp" END IF ELSE Response.Cookies("v_msg_new_user") = "You are not a registered Alumni Website member. Please <a href='newuser.asp'> click here </a> to become a member." Response.Redirect "newuser.asp" END IF |
|
#2
|
|||
|
|||
|
You need to DEBUG your code...only *YOU* can do that!!!
Here...and I strongly suggest putting your SQL Query into a variable for testing purposes <% . . . . . . SET objConn = SERVER.CREATEOBJECT("ADODB.Connection") objConn.OPEN ConnectString Dim strSql strSql = "SELECT EmailAddress, AlumPassword FROM tblAlumni WHERE EmailAddress = '" & v_id & "'" 'FOR DEBUG ONLY 'Response.Write strSql & "<hr>" 'Response.End SET oRs = objConn.Execute strSql IF not oRs.EOF THEN 'FOR DEBUG ONLY 'Response.Write "We have records..." 'Response.End IF v_id <> trim(oRs("EmailAddress")) or v_passwd <> trim(oRs("AlumPassword")) THEN 'FOR DEBUG ONLY 'Response.Write "Inside the TRUE part" 'Response.End Response.Cookies("v_login_msg") = "Incorrect login information. Please re-enter." Response.Redirect "login.asp" ELSE 'FOR DEBUG ONLY 'Response.Write "Inside the Else part" 'Response.End Session("sess_id") = trim(v_id) Response.Redirect "editinfo.asp" END IF ELSE 'FOR DEBUG ONLY 'Response.Write "We have NO records" 'Response.End Response.Cookies("v_msg_new_user") = "You are not a registered Alumni Website member. Please <a href='newuser.asp'> click here </a> to become a member." Response.Redirect "newuser.asp" END IF . . . . . . %> Now...futher DEBUG your code by looking at what's inside this: v_id <> trim(oRs("EmailAddress")) or v_passwd <> trim(oRs("AlumPassword")) Response.Write the value of oRs("EmailAddress") and of oRs("AlumPassword")... It's the only way you'll find **WHY** it is doing what you claim it is! Hope this helps! Sincerely Vlince |
|
#3
|
|||
|
|||
|
IF cstr(v_id) <> (trim(cstr(oRs("EmailAddress"))) or cstr(v_passwd) <> trim(cstr(oRs("AlumPassword"))) THEN
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Either BOF or EOF is True, or the current record has been deleted. Requested operatio |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|