473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Web Server Can't Connect to Sql Server

Hi,

I have two seperate production machines that I'm trying to get to play
nicely together.
This setup has worked for years before - until recently bother
machines were reformatted, and reinstalled fresh. I know I'm missing a
simple setting here somewhere...

I have a Win 2003 IIS 6.0 box running as web server, and a Win 2003
IIS 6.0 box running as a web server with SQL 2000 Server installed.

I can write ASP scripts to access the SQL Server but they only work
from the box running the SQL Server.

If I write ASP scripts to run from the first Win 2003 Web server,
trying to connect to the second box actually running the SQL Server it
gives an error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver][Named Pipes]SQL Server does not
exist or access denied.

If I open up the ODBC Admin on the first Web Server box, and create a
System DSN, and supply it with a SQL Login (the SQL Server is set to
mixed authentication mode and not strictly windows authentication)
the login and test say they complete successfully. However, whenever I
run the ASP script, it errors out.

Example of Connection String that works on box running SQL but not on
first box that is trying to connect to SQL:

strSQL = "SELECT TOP 10 * FROM MAIN ORDER BY [Key] DESC;"

'Create and Open Connection Object
Set objConnection = Server.CreateObject("ADODB.Connection")
objConnection.ConnectionString =
"dsn=**********;uid=*********;pwd=********;"
'System DSN is established on the non-sql machine that this
script is running from
'uid & pwd are SQL accounts.
objConnection.Open

set RsList = objConnection.Execute(strSQL)
I'm sure I've left out vital peices of info here- so please let me
know what you need to know to offer advice.

Much thanks!
-xx75vulcan

Jun 18 '07 #1
6 5368
xx75vulcan (xx********@gmail.com) writes:
If I write ASP scripts to run from the first Win 2003 Web server,
trying to connect to the second box actually running the SQL Server it
gives an error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver][Named Pipes]SQL Server does not
exist or access denied.
Maybe this article can give some clues?
http://support.microsoft.com/default...;EN-US;q328306.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jun 18 '07 #2
On Jun 18, 4:34 pm, Erland Sommarskog <esq...@sommarskog.sewrote:
xx75vulcan (xx75vul...@gmail.com) writes:
If I write ASP scripts to run from the first Win 2003 Web server,
trying to connect to the second box actually running the SQL Server it
gives an error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver][Named Pipes]SQL Server does not
exist or access denied.

Maybe this article can give some clues?http://support.microsoft.com/default...;EN-US;q328306.

--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se

Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
I've read that particular article somewhere before, and I believe I
have the settings/common problems correct.
I'm wondering, do I need to setup a "Linked Server" between the SQL
box and the web box not running SQL?

It appears that "linked servers" provide OLE DB providers and OLE DB
data sources?

Jun 19 '07 #3
ok I just noticed an event on the server (hosting SQL) event log when
attempting to connect from a seperate box.

Error:
An anonymous session connected from FREUDIANA has attempted to open an
LSA policy handle on this machine. The attempt was rejected with
STATUS_ACCESS_DENIED to prevent leaking security sensitive information
to the anonymous caller.

Upon further investigation, lead me to this MS KB: http://support.microsoft.com/kb/839569

Stating "Instead of allowing the anonymous connections to your
instance of SQL Server, you can grant the required access to a
specific SQL Server account and pass the logon credentials for the SQL
Server account in the connection string in the ASP.NET page. Using SQL
Server authentication avoids the anonymous connection attempts to the
instance of SQL Server and is more secure."

I'm passing the SQL login credentials in my connecton string, and the
ODBC manager specifies a SQL account -- why does it tell me it's
attempting an annonymous connection?!?!?!

Jun 19 '07 #4
On Jun 19, 8:40 am, xx75vulcan <xx75vul...@gmail.comwrote:
ok I just noticed an event on the server (hosting SQL) event log when
attempting to connect from a seperate box.

Error:
An anonymous session connected from FREUDIANA has attempted to open an
LSA policy handle on this machine. The attempt was rejected with
STATUS_ACCESS_DENIED to prevent leaking security sensitive information
to the anonymous caller.

Upon further investigation, lead me to this MS KB:http://support.microsoft.com/kb/839569

Stating "Instead of allowing the anonymous connections to your
instance of SQL Server, you can grant the required access to a
specific SQL Server account and pass the logon credentials for the SQL
Server account in the connection string in the ASP.NET page. Using SQL
Server authentication avoids the anonymous connection attempts to the
instance of SQL Server and is more secure."

I'm passing the SQL login credentials in my connecton string, and the
ODBC manager specifies a SQL account -- why does it tell me it's
attempting an annonymous connection?!?!?!

Also noticed the SQL server box is running ODBC SQL Driver
2000.85.1022.00 and the web box (that no asp page can connect through)
is running ODBC SQL Driver 2000.86.1830.00. do they need to be the
same driver version on both boxes?

Jun 19 '07 #5
On Jun 19, 10:27 am, xx75vulcan <xx75vul...@gmail.comwrote:
On Jun 19, 8:40 am, xx75vulcan <xx75vul...@gmail.comwrote:
ok I just noticed an event on the server (hosting SQL) event log when
attempting to connect from a seperate box.
Error:
An anonymous session connected from FREUDIANA has attempted to open an
LSA policy handle on this machine. The attempt was rejected with
STATUS_ACCESS_DENIED to prevent leaking security sensitive information
to the anonymous caller.
Upon further investigation, lead me to this MS KB:http://support.microsoft.com/kb/839569
Stating "Instead of allowing the anonymous connections to your
instance of SQL Server, you can grant the required access to a
specific SQL Server account and pass the logon credentials for the SQL
Server account in the connection string in the ASP.NET page. Using SQL
Server authentication avoids the anonymous connection attempts to the
instance of SQL Server and is more secure."
I'm passing the SQL login credentials in my connecton string, and the
ODBC manager specifies a SQL account -- why does it tell me it's
attempting an annonymous connection?!?!?!

Also noticed the SQL server box is running ODBC SQL Driver
2000.85.1022.00 and the web box (that no asp page can connect through)
is running ODBC SQL Driver 2000.86.1830.00. do they need to be the
same driver version on both boxes?
ANSWER:
I figured it out, but wanted to post for anyone else experiencing this
issue.
While this was a very very odd solution for me, it might just work for
you.

On the second box - that hosts SQL Server, IIS was running, and the
default.htm page - - for whatever reason, included a redirect to the
homepage on the primary server.

I can only assume the connection string (pointing to the sql box) was
being redirected to the primary server - where there was no sql
server.

chris

Jun 19 '07 #6
xx75vulcan (xx********@gmail.com) writes:
I've read that particular article somewhere before, and I believe I
have the settings/common problems correct.
I'm wondering, do I need to setup a "Linked Server" between the SQL
box and the web box not running SQL?
I see that you have sorted out your issue (and as I understand, the
answer was in the domain of web servers, where I know next to nothing),
but I still wanted to answer this.

No, linked servers is nothing about that. When you set up a linked server
in SQL Server, is when you want to access some other data source from
SQL Server. That data source could be another SQL Server, it could be
Oracle, it could be Excel. It could be anything that could be reached
with an OLE DB provider (and indirectly an ODBC driver). But linked servers
is nothing about access into SQL Server.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Jun 19 '07 #7

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

Similar topics

13
by: Fortepianissimo | last post by:
Here is the situation: I want my server started up upon connection. When the first connection comes in, the server is not running. The client realizes the fact, and then starts up the server and...
1
by: Linda Lee | last post by:
I purchased Visual Basic .NET version 2003 Standard I first try to connect Visual Basic .NET 2003 Standard to SQL Server 2000 Personal edition. When I go into Visual Basic .NET under Server...
7
by: CT | last post by:
Hi, This might seem like a basic question but I have some doubts, please humour me. I have a client-server application using java where each client on each machine needs to directly...
4
by: Scott Holland | last post by:
HELP - Need to connect to DB2 database on AIX from NT server. Also AS/400 from NT Server -- I am experienced in ORACLE and a novice at DB2. What tools would be the equivalent of Net*8 or...
0
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager...
9
by: RvGrah | last post by:
After much hair-pulling, I've finally found the answer to a problem that many are fighting with, difficulty connecting from Sql 2005 Server Management or VS2005 to a remote Sql Server running Sql...
8
by: M K | last post by:
I am a newbie at C# (VS 2005) and SQL Server(2003). I was able to create a db using my old pc and then copied it to my laptop to my project folder, I cannot connect to it nor can i create a db on...
0
by: Clodoaldo Pinto | last post by:
Can't connect to postgresql server php error log message: PHP Warning: pg_connect() : Unable to connect to PostgreSQL server: could not connect to server: Permission denied\n\tIs the server...
14
by: Marcus | last post by:
I have a function that simply returns TRUE if it can connect to a particular Sql Server 2005 express, or FALSE if it cannot. I am getting some strange error codes returned when the computer that...
25
by: _DD | last post by:
I'd like to include a 'Test Connection' button in an app, for testing validity of a SQL connection string. I'd prefer to keep the timeout low. What is the conventional way of doing this?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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,...
0
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...

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.