Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Microsoft OLE DB Provider for SQL Server error '80040e4d'

170 views
Skip to first unread message

Edward Yang

unread,
Aug 31, 2000, 12:50:19 AM8/31/00
to
I'm opening a connection to MS SQL Server using SQLOLEDB via NT
Authentication:

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

Aaron Bertrand [MVP]

unread,
Aug 31, 2000, 9:43:46 AM8/31/00
to

Why are you using NT Authentication? I strongly suggest using SQL Server
authentication from ASP.

www.aspfaq.com


"Edward Yang" <edw...@usa.net> wrote in message
news:#we6XbwEAHA.189@cppssbbsa04...

Edward Yang

unread,
Aug 31, 2000, 10:40:43 PM8/31/00
to
Thanks for all your replies.

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

Cade Roux

unread,
Sep 1, 2000, 12:42:40 AM9/1/00
to
I think you definitely want to leave out the authentication information from
your connection string.

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

0 new messages