Access DB using Javascript

change the connection string and the queries as u prefer.And try it ;)

<html>
 <head>
  <title>Entitled Document</title>

<script language="JavaScript">
  function Press(){
   var cn = new ActiveXObject("ADODB.Connection");
   var strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = vt1.mdb;Persist Security Info=False";
   cn.Open(strConn);
   var rs = new ActiveXObject("ADODB.Recordset");
   var SQL = "select * from Table1";
   rs.Open(SQL, cn);
   
while(!rs.eof) {

document.write(rs(1) + "<br>");
rs.MoveNext()
}


   rs.Close();
   cn.Close();
   
  }
  </script>

</head>
 <body>
  <input type="button" value="Press" onclick="Press()">
 </body>
</html>

 

Cheers

Ebook Download
View all
Learn
View all
Araf Global is a software consultancy company founded in 2016 focusing on cutting edge technologies.