Solved

Login Failure using SQLOLEDB

Posted on 2001-07-11
7
855 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
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.

 

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL Help 27 45
Simple SQL query from two tables 13 54
Help Required 3 97
Show Results for Latest DateTime in a View 27 25
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

777 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