INF: Size Restrictions for dbsqlexec(), dbcmd(), and dbfcmd()

Last reviewed: April 25, 1997
Article ID: Q62854

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

There is no size restriction for dbsqlexec(). However, the size of the command buffer is in dbcmd(). No size limitation for dbsqlexec() is present, except that any single call to dbcmd() cannot contain a command larger than 64K. The command buffer is a linked list, which has a separate segment allocated each time a new command is added to the list.

The model you are programming with under MS-DOS will restrict the buffer size. Medium model and Windows are limited to 64K for all DB-Library (DB-Lib) memory needs. OS/2 and MS-DOS large model are limited to available selectors/memory or available memory (respectively). Please remember that DB-Lib under OS/2 or MS-DOS large model does not support huge pointers, so any single memory allocation cannot be larger than 64K.

Dbfcmd() does have a limitation, as stated in the "Microsoft SQL Server Programmer's Reference." It is necessary to approximate how long the formatted output string will be before we can actually call the formatting routines [which are the same as those used by sprintf()]. The size of the buffer allocated for dbcmd() cannot be greater than 1024 characters, or two times the length of the format string.


Additional query words: DB-Lib Windows NT dblib
Keywords : kbprg SSrvDB_Lib SSrvProg
Version : 4.2 | 4.2 | 4.2
Platform : MS-DOS OS/2 WINDOWS


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 25, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.