473,506 Members | 16,994 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

basic connection problem

I'm moving an intranet app from one machine to another. Both are Win2000
Server, with SQL Server 2000. I'm trying to keep them the same in every
possible way. However, when I try to connect to the site through the
browser, I get the following:

Microsoft OLE DB Provider for SQL Server (0x80004005)
Login failed for user 'xxx'. Reason: Not associated with a trusted SQL
Server connection.
/includes/database_connection.inc, line 13
Obviously, I replaced the user name with 'xxx' in the above example.

I have remote sessions with both machines (the one that works and the one
that doesn't) and I am comparing every SQL Server setting, IIS setting,
etc., and cannot see the difference.

Here's the include file that is referenced above ( replaced the actual names
with xxxx's):

<%
Dim strDBConnection
strDBConnection = _
"Provider=SQLOLEDB;" & _
"Persist Security Info=False;" & _
"Data Source=xxxmachinenamexxx;" & _
"User ID=xxx;" & _
"Password=xxx;" & _
"Database=xxxx;"

Dim objConnection
Set objConnection = Server.CreateObject("ADODB.Connection")
objConnection.Open strDBConnection
%>
-------------
I went to ASPFAQ.com and found
http://databases.aspfaq.com/database...look-like.html
but I guess I don't understand it enough to use the info and advice it
provides.
Nov 29 '06 #1
9 1285
Middletree wrote:
...Microsoft OLE DB Provider for SQL Server (0x80004005)
Login failed for user 'xxx'. Reason: Not associated with a trusted SQL
Server connection...

strDBConnection = _
"Provider=SQLOLEDB;" & _
"Persist Security Info=False;" & _
"Data Source=xxxmachinenamexxx;" & _
"User ID=xxx;" & _
"Password=xxx;" & _
"Database=xxxx;"
Have you tried using the .udl trick for creating connection strings? There
may be slight differences in the provider, WINS resolution, etc. that are
revealed when you do so.

For example, I usually see Provider=SQLOLEDB.1 (not SQLOLEDB), and you may
need a fully-qualified machine name: machinename.yourdomain.com. In
addition, the SQL provider expects [Initial Catalog], not [Database]. Each
of these become obvious with the UDL file.

Lastly, you may need to use the Client Network Utility (or Server Network
Utility) to specify protocols.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Nov 29 '06 #2
Good points. I did already specify the proper protocols, because it was
suggested in that article I linked to earlier.

I forgot how to do the UDL trick. You got directions?
Nov 29 '06 #3
Middletree wrote:
Good points. I did already specify the proper protocols, because it
was suggested in that article I linked to earlier.

I forgot how to do the UDL trick. You got directions?
This sums it up as well as any:
http://www.devx.com/tips/Tip/13354

In short, the .udl file is a simple text document containing a connection
string. You double-click it in windows to open with OLEDB Core Services
(where you use a wizard to configure and test your connection), then save
and and open in notepad to read the connection string.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Nov 29 '06 #4
"Middletree" <mi********@hottttttttmail.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
I'm moving an intranet app from one machine to another. Both are Win2000
Server, with SQL Server 2000. I'm trying to keep them the same in every
possible way. However, when I try to connect to the site through the
browser, I get the following:

Microsoft OLE DB Provider for SQL Server (0x80004005)
Login failed for user 'xxx'. Reason: Not associated with a trusted SQL
Server connection.
/includes/database_connection.inc, line 13
Obviously, I replaced the user name with 'xxx' in the above example.

I have remote sessions with both machines (the one that works and the one
that doesn't) and I am comparing every SQL Server setting, IIS setting,
etc., and cannot see the difference.

Here's the include file that is referenced above ( replaced the actual
names with xxxx's):

<%
Dim strDBConnection
strDBConnection = _
"Provider=SQLOLEDB;" & _
"Persist Security Info=False;" & _
"Data Source=xxxmachinenamexxx;" & _
"User ID=xxx;" & _
"Password=xxx;" & _
"Database=xxxx;"

Dim objConnection
Set objConnection = Server.CreateObject("ADODB.Connection")
objConnection.Open strDBConnection
%>
-------------
I went to ASPFAQ.com and found
http://databases.aspfaq.com/database...look-like.html
but I guess I don't understand it enough to use the info and advice it
provides.
Usually, this error arises because the Server instance you are trying to
connect to has been set up for Windows Authentication only. You should make
sure it is set to Mixed Mode.

--
Mike Brind
Nov 29 '06 #5
Mike Brind wrote:
Usually, this error arises because the Server instance you are
trying to connect to has been set up for Windows Authentication
only. You should make sure it is set to Mixed Mode.
That's yet another thing that configuring a UDL would have exposed.

The "not associated with a trusted connection" error can also occur when the
client and server are using different protocols. I have more than once
solved this error with the [Network Library=DBMSSOCN] option.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Nov 29 '06 #6
Usually, this error arises because the Server instance you are trying to
connect to has been set up for Windows Authentication only. You should
make sure it is set to Mixed Mode.
I have tried changing that, but am not sure how to do it. I do know how to
do it when installing SQL Server, but I'm obviously past that point now. I
will Google it, but if you have a quick description of how to do this, I'd
appreciate it.
Nov 29 '06 #7
OK, I figured out how to change the mode, but now get this error:

Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'xxx'.
Nov 29 '06 #8
Middletree wrote:
Microsoft OLE DB Provider for SQL Server (0x80040E4D)
Login failed for user 'xxx'.
It sounds like you have two problems: talking to SQL Server, and
authenticating. You solved the first. The rest is purely a SQL Server issue.

Make sure your new SQL Server instance has the expected Login, and that the
Login has the expected password. Then make sure to grant that Login
appropriate permissions in the target database.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Nov 29 '06 #9
Weird. Turns out that when I copied the database over, it kept all the users
and stuff except for this one. I got it to work by:

1. Switching to mixed mode.
2. Adding a database login by the name I have in my connection string, and
making that login a user on the database.
thanks for your time!
Nov 29 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
9262
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
0
5328
by: Jim S. | last post by:
I'm having a horrible time simply inserting the date in a MySQL database through a Visual Basic program. I have a table, called "ORDERS"; "ID" is the primary key. I'm trying the insert the date,...
1
2124
by: Tom Rahav | last post by:
Hello all! I develop application in Visual Basic .NET and ORACLE database. My question is how do I "send" script file to the database using visual basic .net. Other words, is there any way to...
13
8331
by: bjhartin | last post by:
All, I was working at a client's site when I installed Visual Basic 6 on a machine at their request. Existing applications on this machine had specified version 4.0 of the Jet OLEDB provider in...
5
1522
by: Michael Hesse | last post by:
Hi, I am trying to go from VB to ASP. The following code works perfectly in VB. Dim cn as New SqlConnection Dim sConnect as String = "workstation id=VECTRA\mh;data source=VECTRA;Initial...
3
2943
by: Omar | last post by:
Hi Developers, I am trying to access an Excel data file through a VB.Net application. I have the following code: =================================== VB.Net Code =================== Dim...
13
15524
by: Pete | last post by:
I'm cross posting from mscom.webservices.general as I have received no answer there: There has been a number of recent posts requesting how to satisfactorily enable BASIC authorization at the...
5
3771
by: Microsoft | last post by:
Hi, I have Visual Basic .net 2003 (Standard Edition) & SQL Server 2000 Developer Edition. When trying to create a connection in the server explorer from the .net IDE I get a number of problems;...
4
3037
by: Familjen Karlsson | last post by:
How will the code under look like in Visual Basic .Net, since you can't use the keyword null anymoore in Visual Basic .Net. What can I use instead. SqlConnection connection = null; SqlCommand...
1
9506
by: Tony Stephens | last post by:
Hi, I've created a small forms based application in c# to test a vendor's product and the web service interface that it exposes. We have deployed two instances of the vendor product one which...
0
7218
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
7021
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.