FIX: You receive a "Cannot generate SSPI context" error message when you try to connect to a SQL Server 2000 SP3 server computer (843248)



The information in this article applies to:

  • Microsoft Data Access Components 2.8

SUMMARY

When you try to connect to a Microsoft SQL Server 2000 Service Pack 3 (SP3) server computer from a client computer, the connection fails with an error message if the server name cannot be resolved from the Internet Protocol (IP) address. This behavior occurs because SQLOLEDB incorrectly interprets the return value of the ConnectionGetSvrUser function of dbnetlib.

  • A hotfix resolves this problem.
  • To work around this problem, manually create a host entry for the IP address in the client computer.
  • To reproduce the problem, create and configure the dynamic IP address of the server computer, and then connect to the server computer by using SQL Query Analyzer or Rowset Viewer from a client computer.

SYMPTOMS

When you try to connect a client computer to a Microsoft SQL Server 2000 SP3 server computer, the server name cannot be resolved from the Internet Protocol (IP) address, and the connection fails.

When you connect to the SQL Server 2000 SP3 server computer with SQL Query Analyzer, you receive the following error message:
Server: Msg 11004, Level 16, State 1
[Microsoft][ODBC SQL Server Driver]Cannot generate SSPI context
When you use the SQL Server OLE DB Provider (SQLOLEDB) to connect to a SQL Server 2000 server computer by using Rowset Viewer, you receive the following error message:
Source: "Microsoft OLE DB Provider for SQL Server"

Interface: IID_IDBInitialize
Result: 0x80004005 = E_FAIL

ISQLErrorInfo: [HY000][0x00002afc]
IErrorInfo: [0x00002afc]"Cannot generate SSPI context"

File: D:\MDACTools\rowsetviewer\CBase.cpp
Line: 1067

CAUSE

When SQLOLEDB calls the ConnectionGetSvrUser function of the dbnetlib library, it incorrectly interprets that this function returns a Boolean value. The ConnectionGetSvrUser function is designed to return a void. Therefore, whatever resides in the EAX register becomes the return value.

The ConnectionGetSvrUser function internally calls the gethostbyaddr function. The gethostbyaddr function obtains the host name that corresponds to a particular IP address. If the gethostbyaddr function fails, it returns a zero character to the EAX register. Therefore, the ConnectionGetSvrUser function returns a FALSE value. This behavior causes a logon failure to the SQL Server 2000 SP3 server computer.

RESOLUTION

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question. The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
  Date         Time   Version            Size    File name
   -------------------------------------------------------------- 

   15-Jun-2004  00:22  2000.85.1045.0     28,672  Dbnmpntw.dll     
   15-Jun-2004  00:21  2.80.1045.0       147,456  Msadds.dll       
   15-Jun-2004  00:21  2.80.1045.0       512,000  Msado15.dll      
   15-Jun-2004  00:21  2.80.1045.0       163,840  Msadomd.dll      
   15-Jun-2004  00:21  2.80.1045.0       184,320  Msadox.dll       
   15-Jun-2004  00:21  2.80.1045.0        53,248  Msadrh15.dll     
   15-Jun-2004  00:21  2.80.1045.0       225,280  Msdaora.dll      
   15-Jun-2004  00:21  2.80.1045.0       147,456  Msdart.dll       
   15-Jun-2004  00:21  2.575.1045.0      139,264  Msorcl32.dll     
   15-Jun-2004  00:21  3.525.1045.0      221,184  Odbc32.dll       
   15-Jun-2004  00:22  2000.85.1045.0     24,576  Odbcbcp.dll      
   15-Jun-2004  00:21  2.80.1045.0       442,368  Oledb32.dll      
   15-Jun-2004  00:21  2000.85.1045.0    503,808  Sqloledb.dll     
   15-Jun-2004  00:21  2000.85.1045.0    401,408  Sqlsrv32.dll     
   15-Jun-2004  00:08  2000.85.1045.0    208,896  Sqlxmlx.dll                                  

WORKAROUND

To work around this problem, manually create a host entry on the client computer for the IP address that you want to connect.
  1. Start Windows Explorer.
  2. Locate the Hosts file, and then open the file in notepad.

    Note You can locate the file in the %SystemRoot%\System32\Drivers\Etc path.
  3. Add the following at the end of the file:
    Random IP Computer Name

    Note Random IP is a placeholder for the IP address that is not in use by another computer in the network. Computer Name is a placeholder for the name of the computer that has the SQL Server 2000 SP3 running on it. The Random IP IP address and the Computer Name name must be separated by at least one space.
  4. On the File menu, click Save.
  5. Close the file.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Steps to reproduce the problem

Configure the dynamic IP address

  1. Log on as an administrator to the computer that is running SQL Server 2000 SP3.
  2. In Control Panel, double-click Network Connections.
  3. Double-click the local area connection that you want to modify.
  4. In the Local Area Connection Status dialog box, click Properties. The Local Area Connection Properties dialog box appears.
  5. In the This connection uses the following items box, click Internet Protocol (TCP/IP), and then click Properties. The Internet Protocol (TCP/IP) Properties dialog box appears.
  6. Click Obtain an IP address automatically, and then click OK.
  7. In the Local Area Connection Properties dialog box, click Close.
  8. In the Local Area Connection Status dialog box, click Close.
  9. Click Start, click Run, type cmd, and then click OK.
  10. At the command prompt, type ping Computer Name, and then press ENTER.

    Note Computer Name is a placeholder for the name of the computer that is running SQL Server 2003

    You receive an error message that is similar to the following: Pinging Computer Name [Dynamic IP] with 32 bytes of data:

    Reply from Dynamic IP: bytes=32 time<1ms TTL=128
    Reply from Dynamic IP: bytes=32 time<1ms TTL=128
    Reply from Dynamic IP: bytes=32 time<1ms TTL=128

    Ping statistics for Dynamic IP:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms Note Dynamic IP is a placeholder for the dynamic IP of the Computer Name computer.
  11. To quit the command prompt, type exit, and then press ENTER.
  12. Repeat steps c through e. Click Use the following IP address.
  13. In the IP address box, type the Dynamic IP address.

    Note Dynamic IP is a placeholder for the dynamic IP of the Computer Name computer.
  14. In the Subnet mask box, type the subnet mask for your network.
  15. In the Default gateway box, type the IP address of the computer or of the device on your network that connects your network to another network or to the Internet.
  16. In the Preferred DNS server box, type the IP address of the computer that resolves host names to IP addresses.
  17. In the Alternate DNS server box, type the IP address of the DNS computer that you want to use if the preferred DNS (Domain Name System) server becomes unavailable.
  18. Click Advanced. The Advanced TCP/IP Settings appears.
  19. Under IP addresses, click Add. The TCP/IP Address dialog box appears.
  20. In the IP address box, type Random IP address.

    Note Random IP is a placeholder for the IP address that is not in use by another computer in the network.
  21. In the Subnet mask box, type the subnet mask for your network, and then click Add.
  22. In the Advanced TCP/IP Settings, click OK.
  23. In the Internet Protocol (TCP/IP) Properties click OK. In the Local Area Connection Properties dialog box, click Close. In the Local Area Connection Status dialog box, click Close.

Connect to the SQL Server 2000 SP3 server computer from a client computer through SQL Query Analyzer

  1. Start SQL Query Analyzer. The Connect to SQL Server dialog box appears.
  2. In the SQL Server box, type Random IP.

    Note Random IP is a placeholder for the IP address that is not in use by another computer in the network.
  3. Under Connect using, click Windows authentication.
  4. Click OK. You notice the error message that is mentioned in the "Symptoms" section.

Connect to the SQL Server 2000 SP3 server computer from a client computer through the Rowset Viewer

  1. Start Rowset Viewer. The Microsoft OLE DB RowsetViewer window appears.
  2. On the File menu, click Full Connect. The Full Connect - No Description Available dialog box appears.
  3. In the Provider list, click SQLOLEDB under Connection.
  4. In the DataSource box, type Random IP under Source.

    Note Random IP is a placeholder for the IP address that is not in use by another computer in the network.
  5. Under Login, click DBPROMPT_NOPROMPT in the Prompt list.
  6. On the Properties tab, click Advanced. The IDBProperties::SetProperties dialog box appears.
  7. Click to select the DBPROP_AUTH_INTEGRATED check box, and then click OK.
  8. In the Full Connect - No Description Available dialog box, click OK. You notice the error message that is mentioned in the "Symptoms" section.
Note The client computer and the SQL Server 2000 SP3 server computer must be in the same domain. When you try to connect to the SQL Server 2000 SP3 server computer with the Random IP from the same computer, it connects to the SQL Server 2000 SP3 server computer without error.

REFERENCES

For more information, visit the following Microsoft Developer Network (MSDN) Web sites: For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

323444 How to change the IP address of a network adapter in Windows Server 2003

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates


Modification Type:MajorLast Reviewed:4/7/2006
Keywords:kbQFE KBHotfixServer kbSqlClient kbfix kberrmsg KB843248 kbAudDeveloper