0

Here is the problem, an Intranet webpage has to be created without the server for hosting and i have been trying to update Access database using HTML and javascript but this is not working with the below code plese help

When the below code ran from Visual studio an error which says "Microsoft JScript runtime error: Safety settings on this computer prohibit accessing a data source on another domain." is fired and the connecction was stopped. kindly help me

 <script>

 function removeRow(rnum) {
     jQuery('#rowNum' + rnum).remove();
 }



 function AddRecord() {
     var adoConn = new ActiveXObject("ADODB.Connection");

     var adoRS = new ActiveXObject("ADODB.Recordset");

     adoConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='\\dbName.mdb'");

     //adoConn.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source='C:\sai\TrackerDB.mdb'");
     adoRS.Open("Select * From sai", adoConn, 1, 3);

     adoRS.AddNew;
     adoRS.Fields("requester_name").value = "Quentin";
     adoRS.Update;

     adoRS.Close();
     adoConn.Close();
  }  
   </script>

  <html>
  <input onclick="AddRecord();" type="button" value="Add data" />
  </html>
  • "without the server for hosting" this makes no sense. – Digital Chris Feb 12 '14 at 13:29
  • @DigitalChris I mean i dont have a separate system to host the website on server...it has to run independently with out any installestions, a person opens the html page and he should be able to update the database using html Form. – nothingisimpossible Feb 12 '14 at 13:36

1 Answers1

0

Just try mapping the network driver to a local driver, make sure you map it to the same letter on each computer.

Digital Chris - What he means is: you have a local HTML file with some HTML and SCRIPT and you just open it.

Emil Borconi
  • 3,326
  • 2
  • 24
  • 40
  • I have given the exact path of database "C:\database.mbd" but it is not getting executed for some reaosn , the data is not updated in the database :( – nothingisimpossible Feb 14 '14 at 06:31