Error accessing SQL Server:

Discussion in 'ASP .Net' started by news.microsoft.com, Jun 7, 2005.

  1. Login failed for user '(null)'. Reason: Not associated with a trusted SQL
    Server connection.

    I guess I get this because, my pages are hosted on WinXP IIS and the sql
    server is on Win2k3.



    So my aspnet a/c doesn't match with the Win2k3's aspnet a/c.



    But what is the solution for this?



    Thanks
     
    news.microsoft.com, Jun 7, 2005
    #1
    1. Advertising

  2. Well, let me explain how SQL Server handles security first, so the next time
    this issue comes up in some different fashion, you will know how to deal
    with it.

    SQL Server has 2 security modes: SQL Server only, and Mixed SQL Server and
    Windows authentication. that is, SQL Server has its own built-in
    authentication system, but it can also integrate with the local machine or
    Active Directory to use Windows authentication. SQL Server's authentication
    model is very similar to Windows, in that it has users and groups, and
    specific levels of permissions. When SQL Server uses SQL Server
    authentication, the Connection String must contain the user name and
    password for that user to authenticate. In Windows authentication this is
    not necessary, as the user's Windows credentials are passed in the message
    itself. When using Windows authentication, the user that is requesting
    access to the SQL Server must be a domain user account in Active Directory
    (or the local machine, if the machine is not part of a domain), and that
    account must be explicitly granted SQL Server parmissions.

    Your error message indicates that you are using Windows authentication, in
    which case, the user account under which your ASP.Net application is running
    is not registered with SQL Server as a trusted account. Knowing that, your
    solution is obvious.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Ambiguity has a certain quality to it.

    "news.microsoft.com" <> wrote in message
    news:eTg%...
    > Login failed for user '(null)'. Reason: Not associated with a trusted SQL
    > Server connection.
    >
    > I guess I get this because, my pages are hosted on WinXP IIS and the sql
    > server is on Win2k3.
    >
    >
    >
    > So my aspnet a/c doesn't match with the Win2k3's aspnet a/c.
    >
    >
    >
    > But what is the solution for this?
    >
    >
    >
    > Thanks
    >
    >
    >
    >
     
    Kevin Spencer, Jun 7, 2005
    #2
    1. Advertising

  3. Excellent info!

    Thanks Kevin

    I fixed it by creating a new login and using that.

    I did not know how to give the asp.net a/c which is local on my machine,
    access on sql server, as it can only read and understand AD accounts.

    My webpages are hosted on another machine than the sql server, thus the
    difference.

    Thanks.

    "Kevin Spencer" <> wrote in message
    news:%...
    > Well, let me explain how SQL Server handles security first, so the next
    > time this issue comes up in some different fashion, you will know how to
    > deal with it.
    >
    > SQL Server has 2 security modes: SQL Server only, and Mixed SQL Server and
    > Windows authentication. that is, SQL Server has its own built-in
    > authentication system, but it can also integrate with the local machine or
    > Active Directory to use Windows authentication. SQL Server's
    > authentication model is very similar to Windows, in that it has users and
    > groups, and specific levels of permissions. When SQL Server uses SQL
    > Server authentication, the Connection String must contain the user name
    > and password for that user to authenticate. In Windows authentication this
    > is not necessary, as the user's Windows credentials are passed in the
    > message itself. When using Windows authentication, the user that is
    > requesting access to the SQL Server must be a domain user account in
    > Active Directory (or the local machine, if the machine is not part of a
    > domain), and that account must be explicitly granted SQL Server
    > parmissions.
    >
    > Your error message indicates that you are using Windows authentication, in
    > which case, the user account under which your ASP.Net application is
    > running is not registered with SQL Server as a trusted account. Knowing
    > that, your solution is obvious.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > .Net Developer
    > Ambiguity has a certain quality to it.
    >
    > "news.microsoft.com" <> wrote in message
    > news:eTg%...
    >> Login failed for user '(null)'. Reason: Not associated with a trusted SQL
    >> Server connection.
    >>
    >> I guess I get this because, my pages are hosted on WinXP IIS and the sql
    >> server is on Win2k3.
    >>
    >>
    >>
    >> So my aspnet a/c doesn't match with the Win2k3's aspnet a/c.
    >>
    >>
    >>
    >> But what is the solution for this?
    >>
    >>
    >>
    >> Thanks
    >>
    >>
    >>
    >>

    >
    >
     
    news.microsoft.com, Jun 9, 2005
    #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. =?Utf-8?B?UmV6YQ==?=
    Replies:
    3
    Views:
    18,050
    Carlos Barini
    Jun 7, 2004
  2. Daves
    Replies:
    1
    Views:
    407
  3. Geoff
    Replies:
    3
    Views:
    472
    Patrick.O.Ige
    Jan 16, 2006
  4. farseer

    SQL Server 2005 + SQL Server Express

    farseer, Aug 7, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    360
    farseer
    Aug 8, 2006
  5. Replies:
    0
    Views:
    572
Loading...

Share This Page