none
Help needed -- Can't read MS Access Database via IIS v5.1 XML Web Service RRS feed

  • Question

  • I am using .net 1.1, Visual Studio 2003, IIS 5.1, MS Access 2007 on Win XP Pro

     

    I following the directions in VS 2003 to create a distributed application in Visual Basic.  I encountered several problems.

     

    When I run the appication using the Windows Form, it works OK, as long as I have anonymous access turned on and pointing to my user id.  When I run it using the Web Form, it doesn't work, no matter what I do.  After hanging for about a minute, it comes back with an error stating the "Invoke" failed.  The "Invoke" is trying to access the XML Web Service that I wrote as part of the sample code. 

     

    I tested all connections and it is able to read the database.  It is a very simple database that has three text columns and three rows of data.  Any help would be very much appreciated.

     

    Thanks,

    Fred

     

     

    Wednesday, May 28, 2008 2:46 PM

Answers

  • Is the web application enabled for impersonation? If not then the account under which it executes is ASPNET (Windows XP or 2000) or NetworkService (Windows 2003 or higher). It's very likely that this account does not have sufficient permissions to the folder where the Access database is located (full is required).

     

    If impersonation is enabled and you're using Anonymous (no) authentication then I would expect that you would encounter the same problem with the machines Anonymous account.

     

    Since you're working locally you can either grant full permissions to the above accounts to the folder where the Access database is located, or, you can configure the web app for Integrated Windows NT only (which will require that impersonation be enabled for the web app so that your machine's Admin account will be used).

     

    None of this should have any bearing on whether you can work with the Access database from a Windows Form application (or Microsoft Access).

     

    Just an addendum: It will affect the web service since these accounts are used.

    Thursday, May 29, 2008 6:54 PM
  • Funny you should ask...

    Originally, the web service was set up as impersonate.  But when I add the web reference to the client, it asks for a userid, password & domain.  No matter what I enter, it repeats the question.  To "get around" this, I change the service to "anonymous" using myself as the user.  When I do that, I am able to add the web reference to the client without it asking for a userid, password & domain.  Keep in mind that this is my own personal PC and I am an administrator on the machine.

     

    Fred

     

     

    Wednesday, July 2, 2008 2:28 PM
  • Well, put it this way, any ASP.NET app can now run your COM components so I guess that means you have to have a lot of confidence in preventing a rogue ASP.NET app or script from running on your system.

     

    You would probably be better off creating a new limited account that you can run your ASP.NET application under instead of just going with the default IIS limited account (OK, well it's not so limited any more ;-)).

    Tuesday, July 8, 2008 2:11 AM

All replies

  • Some additional info would be helpful, such as whether the web app is located on the local machine, the location of the web service and also the Access database. Once these components are moved to a network environment then security configuration becomes a primary issue. 

    Thursday, May 29, 2008 3:29 PM
  • Everything is on the local machine.  The web app is in the default website that IIS created when I installed it.  The access database is on the local machine in one of my folders under 'my documents'.  I am logged on as the administrator and am able to update it using the Access interface.

     

    As a reminder, when I test the db connections or preview the data in VS 2003, everything works OK.  It also works when I use the Windows form instead of the Web form.  However, the sample code directs me to shut off anonymous access but when I do, not even the Windows form works.  (The sample code is showing that both the Web form and Windows form access the db via the same web service on the website.)

    Thursday, May 29, 2008 6:22 PM
  • Is the web application enabled for impersonation? If not then the account under which it executes is ASPNET (Windows XP or 2000) or NetworkService (Windows 2003 or higher). It's very likely that this account does not have sufficient permissions to the folder where the Access database is located (full is required).

     

    If impersonation is enabled and you're using Anonymous (no) authentication then I would expect that you would encounter the same problem with the machines Anonymous account.

     

    Since you're working locally you can either grant full permissions to the above accounts to the folder where the Access database is located, or, you can configure the web app for Integrated Windows NT only (which will require that impersonation be enabled for the web app so that your machine's Admin account will be used).

     

    None of this should have any bearing on whether you can work with the Access database from a Windows Form application (or Microsoft Access).

     

    Just an addendum: It will affect the web service since these accounts are used.

    Thursday, May 29, 2008 6:54 PM
  • The access to the database is in a Web Service that I created as part of the project.  Even when I comment out the access to the database, it still hangs.  It now appears that the web client is having trouble accessing the web service.  It appears that the windows app is able to access the web service but the web client is having trouble.  So now I'm really baffled. 

     

    Again, even when the web service is NOT reading the database, the client still hangs.   The error message simply states that the process has timed out!  Which tells me nothing!

     

    Please HELP!!!  I don't know what to do next?????

     

    Thanks,

     

    Fred

     

    Tuesday, July 1, 2008 6:12 PM
  • Are both the web application and web service configured for the same level of authentication? Have you been able to determine whether any of the code in the web service is executing? Or, is the call completely failing?
    Wednesday, July 2, 2008 11:41 AM
  • Funny you should ask...

    Originally, the web service was set up as impersonate.  But when I add the web reference to the client, it asks for a userid, password & domain.  No matter what I enter, it repeats the question.  To "get around" this, I change the service to "anonymous" using myself as the user.  When I do that, I am able to add the web reference to the client without it asking for a userid, password & domain.  Keep in mind that this is my own personal PC and I am an administrator on the machine.

     

    Fred

     

     

    Wednesday, July 2, 2008 2:28 PM
  • Hmm. I would think it would work without issue on your machine if you just configured both the web app and web service for Integrated Windows authentication (w/impersonation).
    Wednesday, July 2, 2008 2:45 PM
  • After much digging, I was finally able to figure out what the problem was....

    User ASPNET did not have Launch and Activiation authority on a COM application.  To get it to work, I added ASPNET to list of Default users that have that authority, thereby giving that user capabilities on all COM applications.  So now the question is; does that give the public any undesireable access to my system?

     

    Thanks very much for all of your help.

     

    Fred

     

     

     

    Monday, July 7, 2008 1:47 PM
  • Well, put it this way, any ASP.NET app can now run your COM components so I guess that means you have to have a lot of confidence in preventing a rogue ASP.NET app or script from running on your system.

     

    You would probably be better off creating a new limited account that you can run your ASP.NET application under instead of just going with the default IIS limited account (OK, well it's not so limited any more ;-)).

    Tuesday, July 8, 2008 2:11 AM