Solved

Login Failure using SQLOLEDB

Posted on 2001-07-11
7
849 Views
Last Modified: 2008-03-03
I try to connect to an SQL server (7.0) database from an IIS application that I am developing using VBSCRIPT (ASP).  The database server and the web server reside on different machines.  I use the following code:


dim CONN
     
set CONN = server.CreateObject("adodb.connection")CONN.ConnectionString = "provider=SQLOLEDB;server=MYSRV;uid=MYUSR;pwd=MYPWD;database=MYDB"
     
CONN.open

I get the following error:

Microsoft OLE DB Provider for SQL Server error '80004005'
Login failed for user 'MYUSR'. Reason: Not associated with a trusted SQL Server connection.

What is a trusted SQL Server connection?  How do I create one?

0
Comment
Question by:desmondg
7 Comments
 
LVL 3

Expert Comment

by:trouta
ID: 6274605
The problem is that the IIS server is using named pipes to try and connect to the database.  It should be using TCP/IP.

If you have the SQL Client on the IIS server, on the IIS server go to the Client Network Utility in the SQL Server 7.0 start menu.  Either enable the protocal TCP/IP and put it at the top of the list or create an alias that uses TCP/IP

Hope this helps
0
 
LVL 7

Accepted Solution

by:
daniel_c earned 100 total points
ID: 6274745
Or the userID and password is invalid.
Are you sure you have used the valid userID and password?
Regarding userID, it can be either from SQL Server userID alone or NT login(if you are using Mixed Security mode).
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 6274985
try this:

"provider=SQLOLEDB;server=MYSRV;user id=MYUSR;password=MYPWD;database=MYDB;"
   
CHeers
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:desmondg
ID: 6275044
The question was answered in the VB area.  I had posted in three areas namely VB, ASP and MS SQL.  Thanks to all you experts that attempted to answer it.

The answer it that the SQL server security must be set to mixed security.

0
 
LVL 7

Expert Comment

by:daniel_c
ID: 6275192
Glad finally you can figure it out Desmond! :)
0
 

Expert Comment

by:CleanupPing
ID: 9282060
desmondg:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 7

Expert Comment

by:daniel_c
ID: 9325034
Moderator:
Last desmondg comment: mixed security which I recommended.
Please take further action.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

Suggested Solutions

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now