Execute MDB from ASPX page?

I'm looking for a way to successfully execute an MDB file from an ASPX page.  Currently I'm using the following code:


It seems to give me the following error message when executed: "System.ComponentModel.Win32Exception: Access is denied"

I have full administrator rights and the authentication mode is set to Windows.  Any ideas on how I might fix this would be greatly appreciated! TIA!

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Even if you have all the rights you mentioned, the process is still going to start under the ASPNET user.  I've never found a way to configure around this, if it is possible, it isn't easy...  You likely can give rights to the ASPNET user and have it work.
Didn't even notice that you were trying to start this from a network, in that case, it'll never work, unless the access DB has "everyone" access.  Why are you trying to start it like this anyway, that's a little weird, I don't see what good will come from that.  If you are trying to get data out, you can connect to it, but don't open it up!
RobinsRLAuthor Commented:
Hmm.  We don't seem to have an ASPNET user account in our Active Directory user list.  I'm trying to find a way to add it now, but I can't seem to figure it out.  
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

RobinsRLAuthor Commented:
The ASPX page is actually masked in an HTML Application (HTA).  The HTA appears every time someone on the network logs in, they can't close it, etc. We want to be able to have this as a central hub for all of our windows and web-based apps.  
It's not a domain account, but a computer level account.  If your webserver runs IIS 6.0, then it will be named "Network Service", but you will never find it under Active Directory.
You can enable impersonation to make your asp.net worker process impersonate a domain account
with enough privilege.

But that would be a serious security problem.
You are going to need a new strategy to do this.  Your HTA page should be opening the Access File, not ASP.net  I've never played with these, but I think you have to write client-side VB code to do that.  If asp.net opens it, it will always open it on the server.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
laotzi, even impersonation doesn't change the identity external processes are started under, it's always going to be ASPNET (or whatever you configure for the processModel in machine.config).  Try it out, you'll see...
RobinsRLAuthor Commented:
I got it work work with the help of raterus' suggestion.  I have the HTA run the following javascript code and it works beautifully!

<script language="JScript">
      var objShell = new ActiveXObject("Shell.Application");

      objShell.ShellExecute("\\\\servername\\sharename\\fileToOpen.mdb", "", "", "open", 1);
      document.location.href = "http://intranet/index.aspx";
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.