I am trying to launch a web service from Visual Web Developer using IIS. When I open the .asmx file in a web browser, I get an error that I do not have permission to access that page.

I am using windows automatic authentication in SQL Server Express. I read that I need to give SQL server the machine username and password to get this to work, but I don't know how to set that up. Can anyone point me in the right direction?


My suspicion is the permissions issue is not with SQL Server (or if it is, that is a separate issue).

Instead I most often encounter what you are seeing when IIS does not have permission to access the source files on the disk. I would suggest going to Explorer, finding the folder containing your source files, and ensuring the account that IIS is running under has permission to read those files.

If that is not the issue, it would be helpful if you could paste the exact error text.

  • Great! I just fixed it. – Bryan Oct 25 '09 at 17:10

Is the error related to SQL Server? If so then you're probably on the right track. There are multiple errors that could cause a webpage to fail.

Windows auth should be fine, as long as the user you are connecting with has access. In the case of IIS, the app pool user needs to be a user that has access to SQL Server. Just create a custom user, assign to the app pool for your site and grant that user access to SQL server.

However, if you do decide to switch to sql auth, also fully acceptable, a good place to start is http://www.connectionstrings.com/. You can get any connection string that you need from there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.