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 [MVP], Nov 6, 2003
    #1
    1. Advertisements

  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.
     
    tropico, Nov 6, 2003
    #2
    1. Advertisements

  3. 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 [MVP], Nov 6, 2003
    #3
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.