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);
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+"'";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With