Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Login Failure using SQLOLEDB

Posted on 2001-07-11
7
Medium Priority
?
869 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 400 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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 

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 does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how the fundamental information of how to create a table.

610 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