Tip

ODBC IP connection troubleshooting

We had to upgrade our Microsoft Data Access Components (MDAC) to version 2.6 on every PC/server and ran into a problem. Each attempt to connect to a SQL Server 7.0 or SQL Server 2000 database using an IP address (rather than the server name) took an extreme amount of time and eventually timed out. After troubleshooting for a day, which included attempting to roll back to the prior version of the MDAC, we came across Microsoft article Q300420, which stated:

    Requires Free Membership to View

In certain reported cases, a "Timeout expired" error is reported to the client application and the connection attempt fails or is extremely slow in its access times. Be aware that if you are using a server alias which maps to a TCP/IP address, this problem can still occur. This problem does not occur with MDAC 2.5 or 2.1 installed.

CAUSE: The MDAC 2.6 version of the SQL Server Network Library, Dbnetlib.dll, attempts to determine the host name of the IP address using a REVERSE lookup in DNS. If the client computer has a slow Domain Naming Service (DNS) server, or no DNS server, and the local HOSTS or LMHOSTS file on the computer does not contain the host name for the IP address of the SQL Server, the reverse lookup will time out after five seconds and/or your access to your databases will be extremely slow.

Note that this is an internal timeout inside of the SQL Server driver code only, and it may or may not generate a timeout error in the client application. The connection attempt can succeed, but every new connection made by the application will encounter the same five-second delay causing an overload of the database.

RESOLUTION: To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. At time of this article, it would be service pack 2.

WORKAROUND: To work around this problem, either provide some reliable means for performing a reverse lookup of the SQL Server server's IP address(setup a reverse lookup zone on your DNS server), use the SQL Server machine name instead of the IP address(which sometimes does not always work on some networks), or apply this hotfix.

Use the HOSTS file or LMHOSTS, put the TCP/IP address of the SQL Server server at the start of the line followed by a few spaces followed by the machine name of the SQL Server server. For example:

123.123.123.123 myservername 

The HOSTS or LMHOSTS file belongs in the System32DriversEtc directory for client computers running Microsoft Windows NT and Microsoft Windows 2000, or in the Windows directory for clients running Microsoft Windows ME, Microsoft Windows 98, or Microsoft Windows 95.

We first tried using the hosts file on a single PC and added each SQL server into it. It corrected everything! Microsoft says in the article that service pack 2 fixes the issue, but it did not for us.

  • What do you think about this tip? E-mail the Editor at tdichiara@techtarget.com with your feedback.
  • The Best SQL Server Web Links: tips, tutorials, scripts, and more.
  • Have an SQL Server tip to offer your fellow DBA's and developers? The best tips submitted will receive a cool prize--submit your tip today!
  • Ask your technical SQL Server questions--or help out your peers by answering them--in our live discussion forums.
  • Check out our Ask the Experts feature: Our SQL, Database Design, Oracle, SQL Server, DB2, metadata, and data warehousing gurus are waiting to answer your toughest questions.

This was first published in February 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.