Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Microsoft OLE DB Provider for SQL Server error '80004005'  unable to connect remotely to database

Posted on 2004-10-22
4
Medium Priority
?
2,843 Views
Last Modified: 2013-12-04
Dear experts,
I have an ASP file on a webserver that needs to connects to a database server remotely. But for some reason it doesn't allow me to do so. I know it is not the database server problem because I tried connecting to it with another computer and IT WORKS data comes out. I tried using a DSN connection on the web server and "TESTS COMPLETED SUCCESSFULLY", but I still cant' get the data to come up on my ASP page.


the error on the ASP page is
Microsoft OLE DB Provider for SQL Server error '80004005'
 "client unable to establish connection"

 I've also tried directly connecting to SQL server which still doesnt' work.

the error on the ASP page is
Microsoft OLE DB Provider for SQL Server error '80004005'
[DBNMPNTW]Access denied.


 I'm pretty sure that it is the web server restricting access but don't know how to unenable it. Any suggestions would be appreciated. I'm on a company network. Is this a problem? I'm getting desperate on this one.

Peter
0
Comment
Question by:tienluong
  • 2
4 Comments
 
LVL 27

Accepted Solution

by:
Asta Cu earned 2000 total points
ID: 12386226
Strange, my comments are not here, yet was sure I posted them.  Here goes again, Peter.

Sounds like a Timeout problem which is disucussed here and MDAC update may help, but other links also included.

Microsoft OLE DB Provider for SQL Server error '80004005'

 have heard many people saying that their web site is chugging along, and suddenly they get this error:
 
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver]Timeout expired
 
or
 
Microsoft OLE DB Provider for SQL Server error '80040e31'
Timeout expired
 
This can often be fixed by "kicking" the server, e.g. hitting refresh on the affected ASP page eliminates the problem. But how about a longer-term fix?
 
If you have MDAC 2.6 installed, upgrade to the latest version of MDAC from Microsoft Data Downloads. As an immediate workaround, force TCP/IP lookup in your connection string and make sure you refer to the SQL Server by IP address, not by name. For more info see Article #2082 and Article #2126.
 
The timeout can be caused by a name -> ip lookup. This is a problem with the version of DBNetLib.dll that shipped with MDAC 2.6 -- see KB #300420 for more information.
 
While a quick bandage would be to increase timeout values (see Article #2066), a better approach would be to make your queries more efficient. For many ideas, see Article #2424.

Source link ->  http://www.aspfaq.com/show.asp?id=2287

Asta
0
 
LVL 6

Expert Comment

by:ryerras
ID: 12386839
This should fix your problem

the following snippet is from the microsoft article following

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver]Client unable to establish connection


CAUSE
This error occurs if SQL Server security mode is set to Microsoft Windows NT only and the NT account that is being used to authenticate the user on the IIS computer (such as IUSR_computer for anonymous IIS access) does not have permissions to connect to the remote SQL Server's NT computer.
RESOLUTION
Using IIS Anonymous Access1. Using NT's User Manager Tool, create an identical NT account, such as IUSR_localcomputer, on the remote SQL Server's NT computer. Give the account a similar password and give it the right to "Log On Locally."
2. Using Internet Service Manager, open the Properties Sheet of the virtual directory for the Web application, select the Directory Security tab, click on the Edit button for Anonymous Access and Authentication Control to display the Authentication Methods. Click the Edit button for Allow Anonymous Access to edit the NT account used for anonymous access, and then clear the check box Enable Automatic Password Synchronization. Save the changes by clicking OK to close the dialog box.

This second step is necessary because of account delegation issues with NT.
Using IIS Basic Authentication1. Refer to the preceding steps if users sign on to IIS using accounts local to the NT server with IIS when prompted for the user name and password by the browser.
2. If users sign on by using a domain account and both NT computers for IIS and SQL Server are in the same domain, ensure that the accounts have the right "Access This computer from a Network" on the SQL Server's NT computer, either directly or indirectly, based on the rights assigned to a group of which the account is a member.

/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
http://support.microsoft.com/kb/253500/EN-US/
0
 

Author Comment

by:tienluong
ID: 12426764
Yes, the MDAC was old. Once I upgraded the MDAC it works fine. Thats to all for the help.
0
 
LVL 27

Expert Comment

by:Asta Cu
ID: 12426849
I had the same issue.  Thanks for the good news and fine grade.  I'm so pleased it helped you.
":0) Asta
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
Article by: btan
The intent is not to repeat what many has know about Ransomware but more to join its dots of what is it, who are the victims, why it exists, when and how we respond on infection. Lastly, sum up in a glance to share such information with more to help…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

916 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