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

Posted on 2004-10-22
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.

Question by:tienluong
    LVL 27

    Accepted Solution

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

    LVL 6

    Expert Comment

    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.


    Author Comment

    Yes, the MDAC was old. Once I upgraded the MDAC it works fine. Thats to all for the help.
    LVL 27

    Expert Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Learn The Basics of Ethical Hacking & Pen Testing

    Computer and network security is one of the fastest growing and most essential industries in technology, meaning companies will pay big bucks for ethical hackers. This is the perfect course to leap into this lucrative career, learning how to use ethical hacking to reveal ...

    The term "Bad USB" is a buzz word that is usually used when talking about attacks on computer systems that involve USB devices. In this article, I will show what possibilities modern windows systems (win8.x and win10) offer to fight these attacks wi…
    Users of Windows 10 Professional can disable automatic reboots using the policy editor. This tool is not included in the Windows home edition. But don't worry! Follow the instructions below to install (a Win7) policy editor on your Windows 10 Home e…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    875 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now