Either BOF or EOF is True??????????????

M

monika

I am getting this error:
Error Type:
ADODB.Field (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested
operation requires a current record.

adn true my first record is empty ... because i want to create one. but i
ahve added both the eof and bof condition and still no help!!!

here is my code :
<%
DIM RSA
DIM QUERY1
DIM RSA2
DIM QUERY2
dim stud
dim MyCount
dim varTxtName
dim varTxtPass

session("TxtName") = Request.form("txtNAME")
varTxtName = session("TxtName")
session("Txtpassword") = Request.form("txtPassword")
varTxtPass = Request.form("txtPassword")

If varTxtNAME <>"" and varTxtPass <> "" and Request("login") = "Login" Then
Set RSA = Server.CreateObject("ADODB.Recordset")
stud = "0"
QUERY1 = "SELECT * from student_info Where student_username='"&varTxtName&
"' and student_password ='"&varTxtPass&"'"
RSA.Open QUERY1, "DSN=school"

session("loggedID") = RSA.fields("student_id").value
'response.write session("loggedID")

If not RSA.BOF and not RSA.EOF then
response.write ("student logged in")
server.transfer("welStudent.asp")
stud = "1"
else
stud = "0"
end if
RSA.Close
Set RSA = Nothing

Set RSA2 = Server.CreateObject("ADODB.Recordset")
QUERY2 = "SELECT * from teacher_info Where teacher_username='"&varTxtName&
"' and teacher_password ='"&varTxtPass&"'"
RSA2.Open QUERY2, "DSN=school"
If not rsa2.bof and RSA2.eof and stud = "0" then
response.write ("teacher logged in!")
server.transfer("teacher.asp")
else
response.write ("a new student")
server.transfer("newStudent.asp")
end if
else
Response.write "Please enter Both the Student Id and the Password!!!"
server.transfer("loginDB.asp")
End If
%>
 
D

Douglas J. Steele

You've got the statement

session("loggedID") = RSA.fields("student_id").value

after you open the recordset, but before you check for BOF and EOF.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top