Solved

Login Failure using SQLOLEDB

Posted on 2001-07-11
7
856 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 143

Expert Comment

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

"provider=SQLOLEDB;server=MYSRV;user id=MYUSR;password=MYPWD;database=MYDB;"
   
CHeers
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
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…

808 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