Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sql statement single quote double quote - Either BOF or EOF is true

Can you please help me with my sql statement? both studentID and password are text. I thought I figured out the single quote and double quote but apparently not as i am getting the error " Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record ".

There is records in my table members.

var mycon;
mycon = new ActiveXObject("ADODB.Connection");
var myrec ;
myrec= new ActiveXObject("ADODB.Recordset"); 
mycon.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data  Source=C:\\Database2.mdb");

var txtpassword = Request.QueryString("txtpassword");
var txtuserID = parseInt (Request.QueryString("txtuserID"));

var sql;
sql = "SELECT * FROM Members WHERE StudentID='"+txtuserID+"'AND  Password='"+txtpassword+"'";  

myrec.Open (sql, mycon);  
like image 874
NewPassionnate Avatar asked Dec 01 '25 06:12

NewPassionnate


1 Answers

txtuserID = parseInt (Request.QueryString("txtuserID"));

You are parsing the txtuserID to an INT.
You should not put it in quotes, so you could change your SQL to:

"SELECT * FROM Members WHERE StudentID= "+txtuserID+" AND  Password='"+txtpassword+"'";
like image 171
Quinton Gindra Avatar answered Dec 03 '25 21:12

Quinton Gindra



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!