FIX: Win16 DBLIB Does Not Restrict Packet Size to 512 for SPX

ID: Q152130


The information in this article applies to:


SYMPTOMS

A DB-Library application for Windows may return the following error when executing a query that returns a large number of rows under IPX/SPX:

Possible Network Error; Read From SQL Server Failed.

This command did not return data, and it did not return any rows DB-Library Process Dead - Connection Broken

When this occurs, the connection will be lost, and closing the application may cause Windows to stop responding.


CAUSE

The Win16 DB-Library DLL (W3dblib.dll or Msdblib3.dll) does not correctly detect the IPX/SPX Net-Library for Windows. As a result, it does not automatically restrict the TDS packet size to 512 bytes. This causes DB- Library to use the default "Network Packet Size" setting on the server side, which is 4096 bytes by default. Due to the architecture limit in DBMSSPX3.DLL, a larger TDS buffer size is not supported. Attempting to use a larger TDS packet size can cause unexpected errors or make the system otherwise unstable.


WORKAROUND

You can work around this problem either by forcing the packet size to 512 through the DBSETLPACKET() DBLIB function or by reducing the default "Network Packet Size" on the server side to 512 bytes.


STATUS

Microsoft has confirmed this to be a problem in SQL Server version 6.5. This problem has been corrected in the latest U.S. Service Pack for SQL Server version 6.5. For information on obtaining the Service Pack, query on the following word in the Microsoft Knowledge Base (without the spaces):

S E R V P A C K


MORE INFORMATION

You can call the DBLIB function, DBSETLVERSION(), to enable the 6.x specific behavior for the application. This will cause the DBLIB to set the TDS packet size according to the "Network Packet Size" setting on the server side, unless you explicitly set the packet size using DBSETLPACKET(). As the default "Network Packet Size" setting is 4096, the DBLIB application will try to use 4096 as the packet size because it cannot correctly detect the SPX Net-Library used. This causes the problem.

The earlier versions of DBLIB for Windows do not set the packet size according to the server-side setting, and 512 is used by default. Therefore, you may not encounter this problem with earlier versions of DBLIB. However, if you explicitly call DBSETLPACKET() to set the packet size larger than 512 bytes, you will encounter this problem even with earlier versions of DBLIB.


Keywords          : kbbug6.50 
Version           : 6.5
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: March 27, 1999