Connection to SQL fails, OK from ASP and VS.NET

Discussion in 'ASP .Net' started by Tom Kaminski [MVP], Nov 6, 2003.

  1. My SQLConnection fails from an aspx using Basic authentication and an
    integrated authentication connection string. An ASP in the same folder
    works 100% OK and I am also able to connect to and work with the database
    using my Windows account through Visual Studio 2003 as well as SQL
    Enterprise Manager - so it seems as though permissions are configured
    correctly on the DB.

    Here's my error message:
    Login failed for user '(null)'. Reason: Not associated with a trusted SQL
    Server connection.

    Here's my connection string:
    data source=mySQLserver;initial catalog=WEB_USAGE_DEV_DB;Integrated
    Security=True;workstation id=ASP_NET

    What am I missing? Why isn't the aspx/IIS sending my credentials to SQL
    Server (when an ASP in the same folder with the same connection string is)?

    --
    Tom Kaminski IIS MVP
    http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
    http://mvp.support.microsoft.com/
    http://www.microsoft.com/windowsserver2003/community/centers/iis/
     
    Tom Kaminski [MVP], Nov 6, 2003
    #1
    1. Advertising

  2. Tom Kaminski [MVP]

    tropico Guest

    On Thu, 06 Nov 2003 08:51:05 -0500, Tom Kaminski [MVP] wrote:
    Your mixing 2 things here. The user who access the web site and the user
    used by your application.

    If your using Trusted_Connection you have to allow the user
    MACHINENAME\ASPNET on your database. Your application is running under
    this user by default.

    If your working with Windows 2003 is the user NT AUTHORITY\NETWORK
    SERVICE wich is used.

    The other possibnility is to specified "user id" and "password" in
    connection string.


    > My SQLConnection fails from an aspx using Basic authentication and an
    > integrated authentication connection string. An ASP in the same folder
    > works 100% OK and I am also able to connect to and work with the database
    > using my Windows account through Visual Studio 2003 as well as SQL
    > Enterprise Manager - so it seems as though permissions are configured
    > correctly on the DB.
    >
    > Here's my error message:
    > Login failed for user '(null)'. Reason: Not associated with a trusted SQL
    > Server connection.
    >
    > Here's my connection string:
    > data source=mySQLserver;initial catalog=WEB_USAGE_DEV_DB;Integrated
    > Security=True;workstation id=ASP_NET
    >
    > What am I missing? Why isn't the aspx/IIS sending my credentials to SQL
    > Server (when an ASP in the same folder with the same connection string is)?
     
    tropico, Nov 6, 2003
    #2
    1. Advertising

  3. "Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
    news:bodje3$...
    > My SQLConnection fails from an aspx using Basic authentication and an
    > integrated authentication connection string. An ASP in the same folder
    > works 100% OK and I am also able to connect to and work with the database
    > using my Windows account through Visual Studio 2003 as well as SQL
    > Enterprise Manager - so it seems as though permissions are configured
    > correctly on the DB.
    >
    > Here's my error message:
    > Login failed for user '(null)'. Reason: Not associated with a trusted SQL
    > Server connection.
    >
    > Here's my connection string:
    > data source=mySQLserver;initial catalog=WEB_USAGE_DEV_DB;Integrated
    > Security=True;workstation id=ASP_NET
    >
    > What am I missing? Why isn't the aspx/IIS sending my credentials to SQL
    > Server (when an ASP in the same folder with the same connection string

    is)?

    Never mind ...

    I had to add:
    <identity impersonate="true"/>

    To my web.config file under the <system.web> section.

    I found my answer after searching this group through google ...

    --
    Tom Kaminski IIS MVP
    http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
    http://mvp.support.microsoft.com/
    http://www.microsoft.com/windowsserver2003/community/centers/iis/
     
    Tom Kaminski [MVP], Nov 6, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Afonin
    Replies:
    1
    Views:
    2,245
    Peter Afonin
    Aug 29, 2003
  2. John Saunders
    Replies:
    1
    Views:
    712
    John Saunders
    Nov 18, 2003
  3. Roy Lawson
    Replies:
    2
    Views:
    491
    Kevin Yu [MSFT]
    Feb 27, 2004
  4. =?Utf-8?B?Z2FsaWNv?=
    Replies:
    8
    Views:
    3,230
    aashishgandhi
    Nov 13, 2007
  5. dayo
    Replies:
    11
    Views:
    376
    Ilya Zakharevich
    Dec 16, 2005
Loading...

Share This Page