Professional Web Applications Themes

SQL Server uses Windows authentication - ASP Database

Hi All Could somebody post me the conn string I would use to enable my ASP page on 1 remote web server to connect to an SQL db on a completely different remote SQL server (windows 2000), which uses Windows authentication. SQL authentication I am fine with, but Windows authen confuses me as to how I put my login details through when the machines are remote. Thanks Robbie...

  1. #1

    Default SQL Server uses Windows authentication

    Hi All

    Could somebody post me the conn string I would use to enable my ASP page on
    1 remote web server to connect to an SQL db on a completely different remote
    SQL server (windows 2000), which uses Windows authentication.

    SQL authentication I am fine with, but Windows authen confuses me as to how
    I put my login details through when the machines are remote.

    Thanks

    Robbie


    Astra Guest

  2. #2

    Default Re: SQL Server uses Windows authentication

    Are the machine in the same domain?

    With Windows Authentication you do not put any credentials in the connection
    string. The connection uses the credentials of whatever thread is opening
    the connection.

    Cheers
    Ken

    "Astra" <com> wrote in message
    news:%phx.gbl... 


    Ken Guest

  3. #3

    Default Re: SQL Server uses Windows authentication

    I have used the following DSN-less string as per recent advice:

    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


    "Ken Schaefer" <com> wrote in message
    news:phx.gbl...
    Are the machine in the same domain?

    With Windows Authentication you do not put any credentials in the connection
    string. The connection uses the credentials of whatever thread is opening
    the connection.

    Cheers
    Ken

    "Astra" <com> wrote in message
    news:%phx.gbl... 



    Astra Guest

  4. #4

    Default Re: SQL Server uses Windows authentication

    Hi,

    I didn't ask for your connection string. I asked if the machines where in
    the same Windows domain. Are they? If so, run your ASP pages under a domain
    user account.

    Cheers
    Ken


    "Astra" <com> wrote in message
    news:phx.gbl... 
    >
    >
    >[/ref]


    Ken Guest

  5. #5

    Default Re: SQL Server uses Windows authentication

    The very first hit in a Google search (I just copied and pasted your error
    message into the search field) revealed this:
    http://support.microsoft.com/?id=811889

    The second one was this:
    http://support.microsoft.com/?id=814401

    Here are the rest of the search results:
    http://www.google.com/search?sourceid=navclient&ie=UTF-8&q=%22Cannot+generate+SSPI+context%22

    Bob Barrows
    Astra wrote: [/ref]

    --
    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

  6. #6

    Default Re: SQL Server uses Windows authentication

    You forgot one link.

    http://www.geocities.com/v_2joecr/images/bart_and_google_search.gif

    Bob Barrows [MVP] wrote:
     

    joker Guest

  7. #7

    Default Re: SQL Server uses Windows authentication

    joker wrote: 
    Well, I don't think this question deserved the label "dumb", but the
    encouragement to use Google is relevant.
    --
    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

  8. #8

    Default Re: SQL Server uses Windows authentication

    That was what I meant. I don't have one that just says to do a google
    search.

    Bob Barrows [MVP] wrote:
     
    >
    > Well, I don't think this question deserved the label "dumb", but the
    > encouragement to use Google is relevant.[/ref]

    joker Guest

  9. #9

    Default Re: SQL Server uses Windows authentication

    Hi guys

    thanks for the postings and mickey takes.

    i know there are lot of SSPI postings, but this looks like an MS round robin
    that's waiting to happen!!!

    Just to confirm, if I get the remote user to config their SQL Server for
    Windows and SQL Server authen (via EManager) then I should be OK with the
    SQL login they created for me - right?

    Thanks

    Robbie

    joker <com> wrote in message
    news:#phx.gbl...
    That was what I meant. I don't have one that just says to do a google
    search.

    Bob Barrows [MVP] wrote:
     
    >
    > Well, I don't think this question deserved the label "dumb", but the
    > encouragement to use Google is relevant.[/ref]



    Laphan Guest

  10. #10

    Default Re: SQL Server uses Windows authentication

    The remote user may not want to allow "sql authentication", because that
    opens up other cans of worms (for example, you then need to get certificates
    to encrypt the transmission of sql server authentication credentials between
    the two servers etc).

    If you have to use SQL authentication, it would be best to use a VPN between
    the two machines (Windows has VPN client built in, and Windows Server has a
    VPN server called RRAS, or there are many hardware VPN devices as well).

    Cheers
    Ken

    "Laphan" <co.uk> wrote in message
    news:%phx.gbl... 
    >>
    >> Well, I don't think this question deserved the label "dumb", but the
    >> encouragement to use Google is relevant.[/ref]
    >
    >
    >[/ref]


    Ken Guest

Similar Threads

  1. Authentication on Windows NT Server w/IIS 5 or 6
    By kodemonki in forum Coldfusion Server Administration
    Replies: 2
    Last Post: September 29th, 08:51 PM
  2. windows authentication and mssql server
    By Tjoep in forum ASP.NET Security
    Replies: 4
    Last Post: April 21st, 06:43 AM
  3. Hybrid sql server and asp.net windows authentication
    By Onur Gorur in forum ASP.NET Security
    Replies: 3
    Last Post: November 12th, 03:34 PM
  4. ASP.NET (IIS 6.0) Windows authentication/SQL Server problem
    By Nick Gilbert in forum ASP.NET Security
    Replies: 2
    Last Post: October 7th, 09:04 AM
  5. ASP.NET + SQL Server Windows authentication
    By Lior Amar in forum ASP.NET Security
    Replies: 4
    Last Post: September 4th, 03:20 AM

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