Professional Web Applications Themes

Cannot Generate SSPI Context - help - ASP Database

Hi All I'm having problems connecting to a remote SQL server with my ASP page, even though I know this page works fine on another remote SQL Server that I ran it on. Basically my ASP page is on a remote web server (ie with my ISP) and it queries and reports data back from an SQL Server on a completely different remote server. My connection string is as follows: strDSN = "Driver={SQL Server};Server=" & strIP & ";Address=" & strIP & ",1433;Network=DBMSSOCN;" strDSN = strDSN & "Database=" & strDB & ";Userid=" & strUserID & ";Password=" & strPwd & ";" All ...

  1. #1

    Default Cannot Generate SSPI Context - help

    Hi All

    I'm having problems connecting to a remote SQL server with my ASP page, even
    though I know this page works fine on another remote SQL Server that I ran
    it on.

    Basically my ASP page is on a remote web server (ie with my ISP) and it
    queries and reports data back from an SQL Server on a completely different
    remote server.

    My connection string is as follows:

    strDSN = "Driver={SQL Server};Server=" & strIP & ";Address=" & strIP &
    ",1433;Network=DBMSSOCN;"
    strDSN = strDSN & "Database=" & strDB & ";Userid=" & strUserID &
    ";Password=" & strPwd & ";"

    All of the params for the above str vars are correct so it isn't the case
    that I have missed anything out in the DSN string.

    I connect via this DSN-less connection, but then get the following error
    message:

    Microsoft OLE DB Provider for ODBC Drivers error '80004005'

    [Microsoft][ODBC SQL Server Driver]Cannot generate SSPI context

    /stocklevels.asp, line 78

    I made the user of this remote SQL Server installation create an SQL
    Server-based login and password for me this morning via Enterprise manager,
    but something is obviously still not right.

    Any ideas of where we have gone wrong?

    Rgds

    Robbie




    Astra Guest

  2. #2

    Default Re: Cannot Generate SSPI Context - help

    Astra wrote: 

    Don't use ODBC! Use a SQLOLEDB connection string
    (www.able-consulting.com/ado_conn.htm). It may not solve this specific
    problem, but it will prevent others.
     
    See this article:
    http://www.aspfaq.com/show.asp?id=2009


    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Guest

  3. #3

    Default Re: Cannot Generate SSPI Context - help

    Hi Bob

    Thanks for coming back to me. Now I get the following error:

    Microsoft OLE DB Provider for SQL Server error '80004005'

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

    /stocklevels.asp, line 82

    Any ideas why?

    Rgds

    Robbie



    "Bob Barrows [MVP]" <SPAMcom> wrote in message
    news:phx.gbl...
    Astra wrote: 

    Don't use ODBC! Use a SQLOLEDB connection string
    (www.able-consulting.com/ado_conn.htm). It may not solve this specific
    problem, but it will prevent others.
     
    See this article:
    http://www.aspfaq.com/show.asp?id=2009


    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.



    Astra Guest

  4. #4

    Default Re: Cannot Generate SSPI Context - help

    The user context (as in the NT name) of the connection should be registered
    with the remote SQL server as a windows authentication user. Have you done
    this?

    --
    Manohar Kamath
    Editor, .netWire
    www.dotnetwire.com


    "Astra" <com> wrote in message
    news:e%phx.gbl... 
    >
    > Don't use ODBC! Use a SQLOLEDB connection string
    > (www.able-consulting.com/ado_conn.htm). It may not solve this specific
    > problem, but it will prevent others.

    > See this article:
    > http://www.aspfaq.com/show.asp?id=2009
    >
    >
    > Bob Barrows
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
    >[/ref]


    Manohar Guest

  5. #5

    Default Re: Cannot Generate SSPI Context - help

    Dear Manohar

    Thanks for your reply.

    If I'm reading your email right, they do have Administrator set up as a
    Windows authenticated user that connects to an SQL Server DB successfully.
    I know this because they have a remote user that connects via a software
    router to an ODBC connection on the SQL Server and this remote user uses
    Administrator and the relevant password to get in.

    However when I tried to the Administrator and relevant password in my
    connection string I received the exact same error message as below.

    How would one connect to a remote SQL Server using Windows authen?

    Rgds

    Robbie


    Manohar Kamath [MVP] <com> wrote in message
    news:phx.gbl...
    The user context (as in the NT name) of the connection should be registered
    with the remote SQL server as a windows authentication user. Have you done
    this?

    --
    Manohar Kamath
    Editor, .netWire
    www.dotnetwire.com


    "Astra" <com> wrote in message
    news:e%phx.gbl... 
    >
    > Don't use ODBC! Use a SQLOLEDB connection string
    > (www.able-consulting.com/ado_conn.htm). It may not solve this specific
    > problem, but it will prevent others.

    > See this article:
    > http://www.aspfaq.com/show.asp?id=2009
    >
    >
    > Bob Barrows
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
    >[/ref]




    Laphan Guest

  6. #6

    Default Re: Cannot Generate SSPI Context - help

    Almost correct...

    The IUSR_<> account on the machine, should have Windows authentication
    rights on the remote SQL server. That way, you do not include the userid and
    password in the connection string. When a connection is "trusted," it means
    the user who is requesting the connection is a user on the SQL server as
    well.

    --
    Manohar Kamath
    Editor, .netWire
    www.dotnetwire.com


    "Laphan" <co.uk> wrote in message
    news:phx.gbl... 
    registered 
    > >
    > > Don't use ODBC! Use a SQLOLEDB connection string
    > > (www.able-consulting.com/ado_conn.htm). It may not solve this specific
    > > problem, but it will prevent others.
    > > 
    > > See this article:
    > > http://www.aspfaq.com/show.asp?id=2009
    > >
    > >
    > > Bob Barrows
    > > --
    > > Microsoft MVP -- ASP/ASP.NET
    > > Please reply to the newsgroup. The email account listed in my From
    > > header is my spam trap, so I don't check it very often. You will get a
    > > quicker response by posting to the newsgroup.
    > >
    > >
    > >[/ref]
    >
    >
    >
    >[/ref]


    Manohar Guest

  7. #7

    Default Re: Cannot Generate SSPI Context - help

    I have used the following DSN-less string:

    strDSN = "Provider=sqloledb; Data Source=" & strIP & "; Initial Catalog=" &
    strDB & "; Integrated Security=SSPI"

    strIP and strDB integrate into the string correctly, but I get the following
    error message:

    Microsoft OLE DB Provider for SQL Server error '80004005'
    Cannot generate SSPI context

    /stocklevels.asp, line 83

    What am I doing wrong?

    Rgds Robbie


    "Manohar Kamath [MVP]" <com> wrote in message
    news:phx.gbl...
    Almost correct...

    The IUSR_<> account on the machine, should have Windows authentication
    rights on the remote SQL server. That way, you do not include the userid and
    password in the connection string. When a connection is "trusted," it means
    the user who is requesting the connection is a user on the SQL server as
    well.

    --
    Manohar Kamath
    Editor, .netWire
    www.dotnetwire.com


    "Laphan" <co.uk> wrote in message
    news:phx.gbl... 
    registered 
    > >
    > > Don't use ODBC! Use a SQLOLEDB connection string
    > > (www.able-consulting.com/ado_conn.htm). It may not solve this specific
    > > problem, but it will prevent others.
    > > 
    > > See this article:
    > > http://www.aspfaq.com/show.asp?id=2009
    > >
    > >
    > > Bob Barrows
    > > --
    > > Microsoft MVP -- ASP/ASP.NET
    > > Please reply to the newsgroup. The email account listed in my From
    > > header is my spam trap, so I don't check it very often. You will get a
    > > quicker response by posting to the newsgroup.
    > >
    > >
    > >[/ref]
    >
    >
    >
    >[/ref]



    Astra Guest

  8. #8

    Default Re: Cannot Generate SSPI Context - help

    Stop using ODBC. Read the following links for more information.

    http://www.aspfaq.com/show.asp?id=2126

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/ado_deprecated_components.asp

    Laphan wrote:
     

    joker Guest

  9. #9

    Default Re: Cannot Generate SSPI Context - help

    Just remember that the IUSR_<> account is a local account by default &
    thus only has access to only the web server by default.

    Manohar Kamath [MVP] wrote:
     

    joker Guest

  10. #10

    Default Re: Cannot Generate SSPI Context - help

    You can change this "anonymous" account to something other than IUSR_
    account. Then, make that user a user on the remote SQL server, and hence
    create a trust.

    --
    Manohar Kamath
    Editor, .netWire
    www.dotnetwire.com


    "joker" <com> wrote in message
    news:uwtsC$%phx.gbl... [/ref]
    and [/ref]
    means 
    >[/ref]


    Manohar Guest

Similar Threads

  1. I can't use the context menu
    By MaxAltera in forum Macromedia Flash Player
    Replies: 0
    Last Post: December 30th, 07:51 PM
  2. Context Menu
    By Alex A.T. in forum Macromedia Flash Player
    Replies: 0
    Last Post: October 13th, 11:12 AM
  3. context root
    By A_Sabrina in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: May 3rd, 10:16 AM
  4. Response is not available in this context
    By MS News \(MS LVP\) in forum ASP.NET General
    Replies: 0
    Last Post: August 6th, 11:05 PM
  5. No Right Context Menu
    By Ben Conn in forum Windows XP/2000/ME
    Replies: 2
    Last Post: July 2nd, 02:39 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139