0

Below is an ActiveX solution to opening an Access program that resides on the users local machine.

  <script type="text/javascript">
    function Start() {
      var connX = new ActiveXObject("Access.Application");
      connX.OpenCurrentDatabase("C:\\Database1.accdb");
      connX.Visible = true;
    }
</script>

I want this to be able to be run from most browsers and not be ActiveX. How do I do that?

Assume use has Access and the OS is Windows 7 or 8 or 10. I would like the solution to work on IE, Edge, Chrome, Firefox, and Safari. If solution can not work on any of those browsers let me know what browsers it does work on.

How does Craig's list call up whatever your email client is and pass that program data like subject and to and body of email?

I was wondering if the same methodology could be use to call the local database client (instead of the local email client) which in this case would be Microsoft Access.

John
  • 131
  • 1
  • 1
  • 8
  • Possible duplicate of [Opening a file in local file system in javascript](http://stackoverflow.com/questions/5534297/opening-a-file-in-local-file-system-in-javascript) – Bob Brinks Aug 10 '16 at 14:48
  • 1
    You can't anymore now that activeX isn't supported. Look into a simple backend to get to the database for you. Only IE will still run activeX. Maybe there's a way to get this to work by having the user select the database file on his local machine through a file input, but I have no idea how to actually open or manipulate the access database once it's available in the script, without activeX. – Shilly Aug 10 '16 at 14:53
  • Did you find a solution? – takintoolong Oct 04 '19 at 12:39

1 Answers1

3

Craigslist activates your email client using a mailto: link. For example, the link below starts a new email to "someone@example.com" in the default email client and fills in the subject "foobar" and the body "qwerty".

<a href="mailto:someone@example.com?subject=foobar&body=qwerty">Email someone</a>

Modern browsers do not expose any interface for launching arbitrary applications on the user's system.

However, some applications do register their own custom URI protocols to allow browser links to launch the app. For example, the Windows 10 Feedback app does this so that you can click a link in your browser and it will take you to a specific place within the app.

It appears some newer versions of Access might do this too. I doubt it will just let you open any old document on the user's system, but you can play around with it and see if it will meet your needs.

Josiah Keller
  • 3,635
  • 3
  • 23
  • 35