none
[DBNETLIB]{ConnectionOpen(Connect()).]SQL Server does not exist or access denied RRS feed

  • Question

  • I am having a problem.

    I am trying to write a simple ASP app to connect to a SQL server and access a database.

    I keep getting the following error:

    [DBNETLIB]{ConnectionOpen(Connect()).]SQL Server does not exist or access denied

     

    I created a C# application and was able to connect and read the data from the table.

    I also created a UDL file and tested the connection, which was successful.

    I am using the connection string from the UDL file, but get the error message stated above.

     

    I tried passing in the Domain Name and Password explicitly as well, but still the same result.

     

    My connection string is:

     

    Provider="SQLOLEDB.1;Data Source=sqlserver4;Intial Catalog=db1;Integrated Security=SSPI;"

     

    The configuration on the server is:

    Windows Server 2003 SP1, SQL Server 2000, IIS 6.0, .NET 2.0.

     

    Any Advice or troubleshooting would be appreciated.

     

    Sunday, June 3, 2007 4:52 AM

All replies

  • Since your ASP application is running under different user account (most likely ASPNET account), you need to grant permissions for that account to access database. See following troubleshooting guide

     

    http://support.microsoft.com/kb/827422/en-us

    Monday, June 4, 2007 10:57 AM
    Moderator
  •  

    VMazur,

     

    Thanks for the reply. I have already checked that.

    I looked at the link as well, still no luck.

     

    The thing that gets me is that I can create a DSN which successfully connects to the DB, but when I use it in the ASP page, it fails.

     

    IV

     

    Tuesday, June 5, 2007 1:57 AM
  • I am pretty sure it is because of the security issue. When you create DSN then you do this under the user account you logged into the system. Now you need to check under which account your ASP application is running. Do you know which one is it? It could be Network Services account. Have you checked it?
    Tuesday, June 5, 2007 11:14 AM
    Moderator
  • I agree with you as I too beleive its a Security Issue, but even if I include my name and password in the connection string, I get the same result

     

    When you say which account its running under, are you referring to the Client side or the Server side?

    And, is that for IIS, the Server, and/or the SQL Server Enterprise Manager settings?

     

    Thanks

    IV

     

    Tuesday, June 5, 2007 1:59 PM
  • You need to check IIS to see under which account your application running. IIS hosts your application under different process and that process uses different account. I beleiev it is Directory Security tab of the Properties for the Web site.
    Wednesday, June 6, 2007 10:33 AM
    Moderator