PRB: MS-DOS Client Cannot Connect If More Than 20 Files Open

ID: Q88565


The information in this article applies to:


SYMPTOMS

An MS-DOS-based DB-Library (DB-Lib) application can have up to 15 connections to SQL Server. But if the application opens any files before making the connections to SQL Server, the number of available connections is reduced by the number of open files.

This is true even if the application is linked with CRT0DAT.OBJ and _FILE.OBJ. These two object files are required if the application needs to open more than 20 files in MS-DOS.

For example, suppose _FILE.C and CRT0DAT.ASM are modified to allow 50 open files. Once the application is compiled and linked with the two object files, it can open up to 45 files successfully (MS-DOS uses five of the 50 file handles). However, the number of connections to SQL Server is still subject to the 20-file limit if the application opens the files before making the SQL Server connections.

In other words, if the application opens 10 files at the start, it can make a maximum of five connections to SQL Server, even if the application can have up to 45 file handles. On the other hand, if the application makes the SQL Server connections first, more files can be opened as long as the total number of connections and open files does not exceed 45. For example, if the application makes 10 connections first, it can then open up to 35 files.


CAUSE

SQL Server consumes the available DB-Lib connections in an MS-DOS-based application if the files are opened before all the available DB-Lib connections are used.


WORKAROUND

Make sure that your MS-DOS-based applications make all connections to SQL Server before opening any other files.

Additional query words: dblib


Keywords          : kbprg SSrvDB_Lib 
Version           : 4.2
Platform          : OS/2 
Issue type        : 

Last Reviewed: March 13, 1999