windows authentication in connect string

  • Any help on this problem:

    I have a classic ASP that needs to connect to a SQLSERVER db using windows domain ID.  The userid and pwd are created in Active directory, SQL Login brought in ..

    But I am not able to connect to the db using the uid/pwd. I get Login failed for the user all the time.

    however if I logon to  the domain using the uid/pwd, I can connect to the SQLSERVER instance/ db ...

    Also cannot create a DSN with that uid/pwd.

     

    -chandrika

     

     

     

     

     

  • Chandrika,

    Your connection string should look like this...

    strConnect = "Provider=sqloledb;Data Source=MyServerName;"Initial Catalog=MyDatabaseName;Integrated Security=SSPI;"

    When using windows authentication. SQL Server does not require a user name and password.

    Norman

  • Hi Norman,

    This does not work. I now get the following message:

    Microsoft OLE DB Provider for SQL Server error '80004005'

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

    my problem is:

    The uid/pwd is created from  windows Active directory and SQL login created for the db.

    I need to access this db via classic ASP only.

     

    chandrika

     

  • Your login failed for "user '(null)'" is due to the configuration of your IIS server - when using integrated security from a web server you need to use a domain user account with the proper permissions on both the web server and SQL server for integrated security to work.

    Depending on your version of IIS/Windows server, setting up the correct credentials for your IIS accounts is different - search for "IIS Integrated Security" in the MS knowledge base for instructions for your version of IIS/Windows. 

    Joe

  • Short answer, don't Windows login from ASP, Use SQL Server login instead:

    ASP

    http://support.microsoft.com/default.aspx?scid=kb;en-us;307002

    ASP.NET

    http://support.microsoft.com/default.aspx?scid=kb;en-us;316989

    Andy

  • okay, here I go again.  Why?


    Cheers,

    david russell

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply