0

i try this code but i don't get any result.. any body can help me /?

function DeleteRecord() {
        alert("dsa");
        var cn = new ActiveXObject("ADODB.Connection");
        //alert(cn);
        var strConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source='C:\\Users\\Khaled\\Desktop\\student.accdb'";
        alert(strConn);
        cn.Open(strConn);
        var rs = new ActiveXObject("ADODB.Recordset");
        var SQL = "select count(*) from info";
        rs.Open(SQL, cn);
        alert(rs(0));
        rs.Close();
        cn.Close(); 
}  
  • This is not pure javascript like you tagged it. You are using a framework for it, and by the looks of it you are ussing AccessDB, so please include that tag so people know where to start if you really want help. Also, what error are you getting? Undefined? And if so, what line of code is the one to blame? Second, have you tried checking this? http://stackoverflow.com/questions/9777038/read-and-write-to-an-access-database-using-javascript – sgarcia.dev Feb 06 '15 at 18:17
  • 1
    Most likely vbscript. Unless this is on a trusted platform (like an Intranet), you shouldn't be using client-side technologies to access the database (security risk). You can do AJAX via javascript safely enough, but the server side page would do the actual database access. – David P Feb 06 '15 at 18:19
  • Check this following link: http://stackoverflow.com/questions/9777038/read-and-write-to-an-access-database-using-javascript – Vijay Bairoju Jan 05 '16 at 17:05

0 Answers0