• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 294
  • Last Modified:

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:

System.Diagnostics.Process.Start("\\servername\share\file.mdb")

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!

0
RobinsRL
Asked:
RobinsRL
  • 5
  • 3
1 Solution
 
raterusCommented:
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.
0
 
raterusCommented:
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!
0
 
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.  
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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.  
0
 
raterusCommented:
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.
0
 
laotzi2000Commented:
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.
0
 
raterusCommented:
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.
0
 
raterusCommented:
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...
0
 
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";
</script>
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now