Dim oConn
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=SQLOLEDB;Data Source=.;Initial Catalog=pubs;User
ID=Administrator;Password=WEB"
I get the following error message:
Microsoft OLE DB Provider for SQL Server error '80040e4d'
Login failed for user 'Administrator'.
/test.asp, line 43
Why???
"Edward Yang" <edw...@usa.net> wrote in message
news:#we6XbwEAHA.189@cppssbbsa04...
Maybe I did not state my problem clear enough.
I have a working web site using SQL Server standard authentication method
(in ASP code). I'm just wondering how I can connect to SQL Server via NT
authentiation, because someone asked me about this problem, saying that he
failed doing this when he expected to succeed.
So, my question is -
How can I connect to SQL Server in ASP/VBScript code using NT
authentication.
Thanks.
"Edward Yang" <edw...@usa.net> wrote in message
news:#we6XbwEAHA.189@cppssbbsa04...
per MSKB Q194641
Did you try specifying no user/password, and make sure SQL Server has access
for the account IIS is running as (will have to be a domain account in the
same domain as SQL Server and IIS, or local account with IIS on same machine
as SQL Server because otherwise SQL Server won't be able to share the
security information)?
I just tried it (SQL Server and IIS on same machine, though), and it works -
with the right connection strings (they are different for OLEDB and ODBC).
I only used the local machine account X, I didn't bother with my home romain
ROUX.
<%@ LANGUAGE="VBSCRIPT" %>
<% Option Explicit %>
<html>
<body>
<%
Dim cn
Dim rs
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open "Provider=SQLOLEDB;Data Source=X;Initial Catalog=SecTest;Trusted
Connection=Yes;Integrated Security=SSPI"
' cn.Open "DRIVER=SQL Server;SERVER=X;DATABASE=SecTest"
Set rs = cn.Execute("SELECT f FROM SecTest")
Do While ( NOT rs.EOF )
Response.Write rs("f") & "<br>"
rs.MoveNext
Loop
%>
</body>
</html>
Having done all this, I alway use SQL Server security for ASP, and I
recommend the same.
Cade Roux
<ca...@acm.org>
http://ourworld.compuserve.com/homepages/cade/
In article <#kqtr37EAHA.62@cppssbbsa04>, Edward Yang wrote:
> From: "Edward Yang" <edw...@usa.net>
> Subject: Re: Microsoft OLE DB Provider for SQL Server error '80040e4d'
> Date: Fri, 1 Sep 2000 10:40:43 +0800
> Newsgroups: microsoft.public.inetserver.asp.db