Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    12

    Unanswered: SQL Server connection

    This is the code I have:

    <%@language=vbscript%>
    <%option explicit%>
    <%response.buffer=true%>

    <%

    Dim conn

    Set conn = Server.CreateObject("ADODB.Connection")
    conn.open "Provider=SQLOLEDB;" &_
    "Data Source=(local);" &_
    "Initial Catalog=ShotWatcher;"&_
    "User ID=sa;"&_
    "Password=; Integrated Security=SSPI; Trusted_Connection=yes"


    If conn.errors.count = 0 Then

    Response.Write "Connected OK"

    End If

    %>

    I keep getting this message:

    Error Type:
    Microsoft OLE DB Provider for SQL Server (0x80040E4D)
    Login failed for user 'FRONT\IUSR_FRONT'.
    /test.asp, line 10


    The Server name is FRONT, it is a localhost

    I have SQL Server Secuirity set to:

    Authenication: SQL Server and Windows

    Audit Level: none

    Start and run SQl Server in the following account: System account

    I don't know why it is not connecting. Could someone please help me or give me some suggestions?

    Thank you,

    Justin Bezanson

  2. #2
    Join Date
    Mar 2003
    Posts
    8
    Hi Justin

    Your connection string is using a integrated security you must create a account that on SQL Server that recognizes FRONT\IUSR_FRONT user.
    You also have to grant permissions on desired databases.

    You can do this using Enterprise Manager

    (fyi FRONT\IUSR_FRONT is the user create at IIS instalation that impersonate users connected at FRONT server)

    you can use these commands in the QA to do this (connected as sa)

    Use Master
    exec sp_grantlogin N'FRONT\IUSR_FRONT'
    exec sp_grantdbaccess N'FRONT\IUSR_FRONT', N'IUSR_FRONT'
    Use ShotWatcher
    exec sp_grantdbaccess N'FRONT\IUSR_FRONT', N'IUSR_FRONT'
    exec sp_addrolemember N'db_owner', N'IUSR_FRONT' -- or other privilege

    Good luck
    Robinson

  3. #3
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    And if you ARE using Windows Authentication, then you don't need to specify User ID and Password in your connection string.

  4. #4
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578
    Another KBA to resolve the issue.
    --Satya SKJ
    Microsoft SQL Server MVP
    [IMG]http://sqlserver-qa.net/google_bart.gif[/IMG]

  5. #5
    Join Date
    Mar 2004
    Posts
    12
    thank you so musch!! It worked

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •