Using Access database in a webservice

Hi,

I created a simple webservice to fetch a value in an Access database.
When I try to open the connection I get the following exception:
"Cannot open file: you need permission to view its data"

If I use the same database in a normal winforms application then there
is no problem.

Anyone got an idea
Thanks.
Robin.


Answer this question

Using Access database in a webservice

  • fumble

    Server 2003 uses a later version of IIS and there is a different account name for the service.  The reason for this is that the IIS account hosts ASP.NET differently to gain some extra performance.  There is another user you need to grant access to in this case, and I'm not sure what.  Browse your user list, and the appropriate user will have a comment/description that would readily identify it.
  • Ritesh Mehta

    Yep, you have to grant ASP .NET permission to open the access database.  When you are logged in you are running as your logged in user.  When opening from the WebService you are operating under the ASP .NET Worker Process account.  Simply grant permissions to access the file to MACHINENAME\ASPNET
  • jvervoorn

    I right-clicked the Access database file and in the security I added 
    ASP.NET Machine Account (BARCELONA/ASP.NET) but I still have the
    same problem. I am a beginner with windows server 2003...
    Any idea


  • Using Access database in a webservice