troubleshooting Question

Local HTML file to display local Access MDB data in browser

Avatar of xenium
xenium asked on
HTMLChromeJavaScriptMicrosoft AccessWeb Browsers
4 Comments3 Solutions1167 ViewsLast Modified:
hi,

I came across the following code which works perfectly in IExplorer. Is there a way to make it work in Chrome or Edge? For a javascript total newbie.

<html>

<title>test javascript to read ms access data</title>

<script type="text/javascript">
//http://www.webdeveloper.com/forum/showthread.php?1957-Reading-Writing-data-in-MS-Access-database-using-javascript
var pad = "C:\\Alex\\test.mdb";
var cn = new ActiveXObject("ADODB.Connection");
var strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pad;
cn.Open(strConn);
var rs = new ActiveXObject("ADODB.Recordset");
var SQL = "SELECT * FROM Org";
rs.Open(SQL, cn);
if(!rs.bof) {
rs.MoveFirst();
if(!rs.eof) {
document.write("<p>" + rs.fields(0).value + ", ");
document.write(rs.fields(2).value + ".</p>");
}
}
else {
document.write("No data found");
};
rs.Close();
cn.Close();
</script>

</html>

thanks
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 3 Answers and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros