• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3106
  • Last Modified:

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

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.

  • 2
1 Solution
Asta CuTechnical consultant & graphic designCommented:
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
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

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

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.
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.

tienluongAuthor Commented:
Yes, the MDAC was old. Once I upgraded the MDAC it works fine. Thats to all for the help.
Asta CuTechnical consultant & graphic designCommented:
I had the same issue.  Thanks for the good news and fine grade.  I'm so pleased it helped you.
":0) Asta
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

On-Demand: Securing Your Wi-Fi for Summer Travel

Traveling this summer?Check out our on-demand webinar to learn about the importance of Wi-Fi security and 3 easy measures you can start taking immediately to protect your private data while using public Wi-Fi. Follow us today to learn more!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now