Microsoft KB Archive/843248

= FIX: You receive a &quot;Cannot generate SSPI context&quot; error message when you try to connect to a SQL Server 2000 SP3 server computer =

Article ID: 843248

Article Last Modified on 11/15/2007

-

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: &quot;Microsoft OLE DB Provider for SQL Server&quot;

Interface: IID_IDBInitialize

Result: 0x80004005 = E_FAIL

ISQLErrorInfo: [HY000][0x00002afc]

IErrorInfo: [0x00002afc]&quot;Cannot generate SSPI context&quot;

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. However, this hotfix is intended to correct only the problem that this article describes. Apply this hotfix only to systems that are experiencing this specific problem.

To resolve this problem, submit a request to Microsoft Online Customer Services to obtain the hotfix. To submit an online request to obtain the hotfix, visit the following Microsoft Web site:

http://go.microsoft.com/?linkid=6294451

Note If additional issues occur or any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. To create a separate service request, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

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.
 * 1) Add the following at the end of the file:

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



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



Configure the dynamic IP address
 Log on as an administrator to the computer that is running SQL Server 2000 SP3. In Control Panel, double-click Network Connections. Double-click the local area connection that you want to modify. In the Local Area Connection Status dialog box, click Properties. The Local Area Connection Properties dialog box appears.</li> 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.</li> Click Obtain an IP address automatically, and then click OK.</li> In the Local Area Connection Properties dialog box, click Close.</li> In the Local Area Connection Status dialog box, click Close.</li> Click Start, click Run, type cmd, and then click OK.</li> At the command prompt, type ping, and then press ENTER.

Note  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  [ ] with 32 bytes of data:

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

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

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

Ping statistics for :

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 0ms, Average = 0ms

Note  is a placeholder for the dynamic IP of the   computer.</li> To quit the command prompt, type exit, and then press ENTER.</li> Repeat steps c through e. Click Use the following IP address.</li> In the IP address box, type the  address.

Note  is a placeholder for the dynamic IP of the   computer.</li> In the Subnet mask box, type the subnet mask for your network.</li> 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.</li> In the Preferred DNS server box, type the IP address of the computer that resolves host names to IP addresses.</li> 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.</li> Click Advanced. The Advanced TCP/IP Settings appears.</li> Under IP addresses, click Add. The TCP/IP Address dialog box appears.</li> <li>In the IP address box, type address.

Note  is a placeholder for the IP address that is not in use by another computer in the network.</li> <li>In the Subnet mask box, type the subnet mask for your network, and then click Add.</li> <li>In the Advanced TCP/IP Settings, click OK.</li> <li>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.</li></ol>

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.

Note  is a placeholder for the IP address that is not in use by another computer in the network.
 * 1) Under Connect using, click Windows authentication.
 * 2) Click OK. You notice the error message that is mentioned in the &quot;Symptoms&quot; 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   under Source.

Note  is a placeholder for the IP address that is not in use by another computer in the network.
 * 1) Under Login, click DBPROMPT_NOPROMPT in the Prompt list.
 * 2) On the Properties tab, click Advanced. The IDBProperties::SetProperties dialog box appears.
 * 3) Click to select the DBPROP_AUTH_INTEGRATED check box, and then click OK.
 * 4) In the Full Connect - No Description Available dialog box, click OK. You notice the error message that is mentioned in the &quot;Symptoms&quot; 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  from the same computer, it connects to the SQL Server 2000 SP3 server computer without error.

<div class="references_section">