Friday, March 30, 2012

log into one sql server from another server

I have two servers that have IIS and SQL 2000. the first
one is where I have my webpages. The second one is where
I have my sql tables. The second server's IIS has
anonymous login unchecked (same with the first server). I
want to use the person's windows login for authentication.
In the first server's include file, my connection code is:
Dim cn
set cn=server.createobject("ADODB.Connection")
cn.open "Provider=sqloledb;Data
Source=secondservername;Initial Catalog=Client;Integrated
Security=SSPI"
When I try to view a webpage with the include file, I get
this error:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
Where is this error coming from?
If I put the webpages on the secondserver, the pages are
viewed just fine.
NganYou need to use delegation in AD with kerberos enabled to
use Windows logins across linked servers. You can find more
info on this in books online under the topic:
Security Account Delegation
You are probably experiencing the issues addressed in the
following article:
PRB: Message 18456 from a Distributed Query
http://support.microsoft.com/?id=238477
If you aren't using AD, kerberos then you will need to use
the work around with SQL logins as mentioned in the above
article.
-Sue
On Thu, 24 Jun 2004 11:22:49 -0700, "ngan"
<anonymous@.discussions.microsoft.com> wrote:

>I have two servers that have IIS and SQL 2000. the first
>one is where I have my webpages. The second one is where
>I have my sql tables. The second server's IIS has
>anonymous login unchecked (same with the first server). I
>want to use the person's windows login for authentication.
>In the first server's include file, my connection code is:
>Dim cn
>set cn=server.createobject("ADODB.Connection")
>cn.open "Provider=sqloledb;Data
>Source=secondservername;Initial Catalog=Client;Integrated
>Security=SSPI"
>When I try to view a webpage with the include file, I get
>this error:
>Microsoft OLE DB Provider for SQL Server (0x80040E4D)
>Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.
>Where is this error coming from?
>If I put the webpages on the secondserver, the pages are
>viewed just fine.
>Ngan
>

No comments:

Post a Comment