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

Last reviewed: April 28, 1997
Article ID: Q88565

The information in this article applies to:
  • Microsoft SQL Server Programmer's Toolkit, version 4.2

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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 28, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.