ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 2nd, 2003, 09:04 AM
haroon haroon is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 1 haroon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old September 2nd, 2003, 09:17 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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

Reply With Quote
  #3  
Old September 2nd, 2003, 12:34 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
IF cstr(v_id) <> (trim(cstr(oRs("EmailAddress"))) or cstr(v_passwd) <> trim(cstr(oRs("AlumPassword"))) THEN

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Either BOF or EOF is True, or the current record has been deleted. Requested operatio


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway