title: Connecting to MS Access using Javascript
body: <p>I tried the following code for establishing a connection with a database(MS Access)..But am getting an error as "Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype"</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Insertion&lt;/title&gt;
  &lt;script type="text/javascript" language="JavaScript" &gt;
  function AddRecord(form) {
   var cn = new ActiveXObject("ADODB.Connection");
          var strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:\\Users\\deepakgopal\\Desktop\\Testing\\Database3.mdb";
          cn.Open(strConn);
          var rs = new ActiveXObject("ADODB.Recordset");
          var SQL = "select count(*) from data";
          rs.Open(SQL, cn);
          alert(rs(0));
          rs.AddNew
          rs.Fields("VDI") = Request.Form("vdi");
          rs.Fields("Staff") = Request.Form("staff");
          rs.Update;   
          rs.Close();
          cn.Close(); 
  
  }
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body style="margin:0 auto;"&gt;
  VDI: &lt;input type="text" id="tname" name="vdi" /&gt;
  &lt;br /&gt;
  Staff : &lt;input type="text" id="tpwd" name="staff" /&gt;
  &lt;br /&gt;
  &lt;input type="button" id="btnsbt" name="btnsbt" value="Login" onclick="AddRecord()" /&gt;&lt;br /&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>