Login | Register | FAQ
Anonymous

Javascript error: Either BOF or EOF is True, or the current

+ Post a reply

2 posts Page 1 of 1


Javascript error: Either BOF or EOF is True, or the current

by jayavinoth » Wed Nov 12, 2014 6:42 am

I created the below javascript to check whether the given email id is already exixt in ms access database and getting the below error. Could anyone please help me to get rid of this. Thanks in advance...

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

Code: Select all
    <html>
    <head>
    <script>
    function fnchk()
    {
    var eid = document.f1.t1.value;
    var cn = new ActiveXObject("ADODB.Connection");
    var rs = new ActiveXObject("ADODB.Recordset");
    cn.open("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=/\dth.accdb;");
    var qry = "select * from reg where email = '"+ eid +"'";
    rs.open(qry,cn,1,3);
    if(eid == rs.fields("email").value)
    {
    alert("Email exists");
    }
    else
    {
    alert("Email not exist");
    }
    rs.close();
    cn.close();
    }
    </script>
    </head>
    <body>
    <form name="f1">
    <input type="text" name="t1">
    <input type="button" value="ok" onclick="fnchk();">
    </form>
    </body>
    </html>
User avatar

jayavinoth

  • Posts: 73
  • Joined: Tue May 17, 2011 2:36 pm

Re: Javascript error: Either BOF or EOF is True, or the curr

by XainPro » Thu Nov 27, 2014 9:43 am

Connecting to a Database

To create a new database connection, use the ACCESSdb contructor to create a new instance of the ACCESSdb object, passing a string containing the path to the Access .mdb file. (Make sure to double up on the backslashes!):

var myDB = new ACCESSdb("C:\\dbfile.mdb");


To see warning popups for database errors, add the optional showErrors parameter:

var myDB = new ACCESSdb("C:\\dbfile.mdb", {showErrors:true});


Running a Query

To query a database, use ACCESSdb's query method:

var SQL = "SELECT * FROM myTable";
var resultSet = myDB.query(SQL);


var SQL = "INSERT INTO myTable VALUES(123, 'abc 123', 'xyz')";
if(myDB.query(SQL)) {
alert("Inserted!");
}


If a query fails, the method returns false:

var SQL = "UPDATE myTable SET col1 = 456, col2 = 'def 456', col3 = 'zyx' WHERE col1 = 123";
if(!myDB.query(SQL)) {
alert("Oh no!");
}
User avatar

XainPro

  • Posts: 3933
  • Joined: Fri Feb 17, 2012 8:10 pm


+ Post a reply

Page 1 of 1